The Toffees went ahead via a Leighton Baines penalty on 20 minutes but the Swans deservedly equalised through Wilfried Bony.
After the break, Romelu Lukaku restored Everton's advantage on 53 minutes and Ross Barkley, who had won the earlier penalty, added a third goal five minutes later to establish a cushion.
But Swansea kept pushing and skipper Ashley Williams pulled a goal back in injury time to set up a nervy finish.
However, Martinez's side held on to claim the win - their seventh in a row in all competitions at home - to climb into fifth in the table as they push to qualify for European competition next term.
Martinez was pleased to get the win against his former side, believing the Toffees showed maturity to grind out the victory.
He told Sky Sports: "Swansea City are a very good side, technically they are really strong.
"I thought we started the game really well, the first 20 minutes we got the goal and from that point on, I think we finished the half really poorly and that allowed Swansea to have a well-deserved equaliser.
"I think the second half, we started with a better intensity, with a better intent, and that gave us a two-goal cushion and from that point on, we probably sat back a little bit."
He added: "Overall it was a difficult game, don't make a mistake about it. We are just pleased to get those three points and obviously that maintains a very good run at home.
"Today was a really important game and I felt we had really good maturity and we knew how to play the game and I was very pleased with the whole performance apart from that period (at the end of) the first half."