It was a deserved victory for the Toffees as Martinez enjoyed a successful return to his former club.
The first half was a drab affair although Everton had the best chance to break the deadlock when poor play by Chico Flores gifted possession to Kevin Mirallas.
The chance was wasted though as Mirallas opted to shoot when a pass to a team-mate seemed the better option and Gerhard Tremmel was able to make a comfortable save.
Tremmel then dropped a looping free-kick at the feet of Romelu Lukaku, but the goalkeeper was able to recover before the Everton striker could turn the ball home.
In Swansea's best move of the first half, Wayne Routledge surged forward before finding Wilfried Bony with a precise pass only for the striker to then lift his left-footed drive way over Tim Howard's goal.
Everton began to look more threatening after the break with Steven Pienaar dragging a shot wide before Barkley slipped at the vital moment when a goal seemed imminent.
Gareth Barry then hooked a volley just over the bar after Sylvain Distin had headed the ball on to him.
Barkley powered forward and let fly with a great shot that Tremmel touched on to the crossbar before, in the 66th minute, Seamus Coleman's swerving shot beat the Swans keeper and gave Everton a deserved lead.
Just four minutes later, and against the run of play, Dwight Tiendalli got ahead of the day-dreaming Pienaar and saw his shot deflect off Bryan Oviedo before going over the line.
However, Barkley grabbed the winner when his 84th-minute free-kick beat the Swans wall and found the gap between the crossbar and Tremmel.
Howard ensured Everton would be returning to Merseyside with all three points when he tipped substitute Roland Lamah's stoppage-time volley over the bar and away for a corner.