Everton were pegged back to 1-1 as Juan Cala cancelled out Gerard Deulofeu's opener in the second half, but Seamus Coleman struck in the dying seconds to seal three points.
Martinez had some sympathy for Cardiff after the final whistle but pointed to the superb display of visiting goalkeeper David Marshall as evidence that Everton had been the better team.
"I think Cardiff deserve great credit. They found a real togetherness and a great will in their performance, and I knew it was going to be difficult," he told Sky Sports.
"We made it even harder because when you have clear-cut chances you have to take them, but I think the final scoreline is right.
"I think David Marshall in goal was phenomenal. I don't think I have seen a better goalkeeping performance this season.
"Over the course of the season these moments do sort of level up, so after conceding a goal in the 93rd minute against Chelsea I feel today is a little bit of a reward for the effort we put in that performance.
"It is a little bit harsh on Cardiff because you don't want to lose the point in the last seconds of the game, but I think overall it is fair to say we deserved the three points."
Martinez does not think Everton have always got the results their performances deserve this season, but insists there is a determination to finish the campaign strongly.
He explained: "We are taking each game as a unique opportunity to get the points that I think we deserve over the course of the season, and today was a clear example of having that character and desire within the group to keep doing the right things until the last whistle."
Ole Gunnar Solskjaer suggested after the match that Cardiff should have had a penalty for a foul on Wilfried Zaha by Sylvain Distin, but the Bluebirds were perhaps lucky not to have a man sent off earlier when Kevin Theophile-Catherine was only shown a yellow card following a bad challenge on Gareth Barry.
Asked about the penalty claims, Martinez said: "I haven't seen the replay, but there were two big calls, that one and the red card in the first half, so I think it was a difficult game for the referee."
Martinez also gave his backing to Cardiff's survival bid, adding: "I think the manager has brought a real tactical flexibility that is going to give them a lot of points, and they did not look today like a team that was struggling near the bottom of the table."