Francesco Guidolin's reign as Swansea head coach began with an impressive and much-needed victory at Everton.
The Italian oversaw an improved display from the Swans, who led through Gylfi Sigurdsson's penalty.
The hosts levelled when Gareth Barry's near-post flick from a corner was touched into his own net by Jack Cork but Ayew's deflected strike won it.
Everton missed a host of chances, the best of which Seamus Coleman put over from six yards with the final kick.
This was the Welsh side's first league win over Everton but, more importantly, it is the first time they have managed successive victories in the Premier League this season, adding to Monday's 1-0 home success over Watford.
They are up to 15th in the table and now have a cushion between themselves and Newcastle in 18th and a momentum that eludes their relegation rivals.
It is another disappointing result for the Toffees, who twice threw away a lead to draw at Chelsea last weekend and have now won just three of their past 14 matches at Goodison Park and one win in 10 league matches overall.
They are 12th in the table having gone into the campaign hoping to improve on last season's 11th-placed finish.
Guidolin, 61, has spent the majority of his 30-year managerial career in Italy, most recently with Udinese, who he motivated to gain results seemingly beyond their means.
If he is to perform a similar task at Swansea, who had won just once in 11 Premier League away games prior to Sunday, he has begun in the right fashion.
Last weekend, Guidolin watched from the stands as the Swans ground out a narrow win over Watford - but they were more forceful from the start at Everton, working hard to win the ball high up the pitch and moving it effectively when they did.
In the opening 15 minutes they had over 60% of possession and took their first-half chances when they came, scoring from both of their shots on target.
Both goals came with a helping hand from home defender John Stones. His under-hit back-pass allowed Ayew to nip in and draw a foul from Tim Howard for the penalty, then his sliding attempt to block the Ghana forward's shot took it past the keeper for the second.
Swansea rode their luck on occasion as Everton went in search of an equaliser after the break, but they showed discipline and determination that will stand them in good stead for a relegation battle.
Everton were on the wrong end of a couple of referee decisions on Sunday - a handball by Ashley Williams to set up the move from which Ayew scored Swansea's second and a dismissed claim for a penalty when Neil Taylor blocked Coleman's cross with his arm.
They were also unlucky to suffer two injuries in the first half, which deprived them of Kevin Mirallas and Muhamed Besic, who had hit the post with the first shot of the game.
Ultimately, though, the home side have only themselves to blame for their failure to gain at least a point from the game.
Stones' error and misfortune helped the Swans score their goals, while the Toffees' own wastefulness prevented them adding to their leveller, which found the far corner of the net off Cork after Barry had flicked on a Deulofeu corner.
Spanish winger Deulofeu delivered several crosses from the right that his team-mates were unable to convert, Romelu Lukaku twice headed over and Coleman dragged a shot wide before somehow side-footing over from just a few yards out in the final minute of added time.
Everton manager Roberto Martinez: "We were very slow in our performance - pedestrian - but two aspects affected our momentum which was the two injuries.
"The first half and second half performance were very contrasting.
"We created enough chances to win the game. The fearful aspect of our performance was a real shame."
Swansea manager Francesco Guidolin: "Six points in two matches is very important for us because the table was not good.
"Now it is not very good. I hope to have the possibility to go up in the table.
"In this moment I am very happy. This is the first match in Premier League for me. I dreamed of working in Premier League but I didn't dream of winning the first match.
"I must understand what happens in this day because I am surprised. It is new for me."
Everton have a cup double next. They are in Capital Cup action, taking a 2-1 lead to Manchester City for the second leg of the semi-final on Wednesday before then going to Carlisle in the fourth round of the FA Cup next Sunday.
Swansea travel to West Brom - who are now just three points above them - for another big Premier League fixture on Tuesday, 2 February.
Full Time Match ends, Everton 1, Swansea City 2.
90:00 +4:47 Full timeFull Time Second Half ends, Everton 1, Swansea City 2.
90:00 +4:36Attempt missed. Seamus Coleman (Everton) left footed shot from very close range is too high. Assisted by John Stones following a corner.
90:00 +4:35Attempt missed. John Stones (Everton) header from the centre of the box misses to the right. Assisted by Leighton Baines with a cross following a corner.
90:00 +4:19Corner, Everton. Conceded by Jordi Amat.
90:00 +1:32Tom Cleverley (Everton) wins a free kick on the right wing.
90:00 +1:32Foul by Leon Britton (Swansea City).
90:00 +0:44Attempt missed. Romelu Lukaku (Everton) header from the centre of the box is close, but misses the top right corner. Assisted by Gerard Deulofeu with a cross.
90:00 +0:17 SubstitutionSubstitution Substitution, Swansea City. Kyle Naughton replaces Angel Rangel.
88:20 SubstitutionSubstitution Substitution, Swansea City. Eder replaces André Ayew.
87:37Attempt missed. Seamus Coleman (Everton) right footed shot from the centre of the box misses to the left. Assisted by John Stones with a through ball.
85:30Attempt saved. Romelu Lukaku (Everton) header from the centre of the box is saved in the bottom right corner. Assisted by Ross Barkley with a cross.
84:49Attempt blocked. Steven Pienaar (Everton) left footed shot from outside the box is blocked. Assisted by Gareth Barry.
80:43Ross Barkley (Everton) wins a free kick in the attacking half.
80:43Foul by Leon Britton (Swansea City).
77:29Attempt blocked. Romelu Lukaku (Everton) left footed shot from outside the box is blocked. Assisted by Gareth Barry.
76:45Foul by Romelu Lukaku (Everton).
76:45Federico Fernández (Swansea City) wins a free kick in the defensive half.
76:24 SubstitutionSubstitution Substitution, Swansea City. Jordi Amat replaces Wayne Routledge.
72:06Attempt missed. John Stones (Everton) right footed shot from the centre of the box is close, but misses to the right following a corner.
Attempt blocked. Romelu Lukaku (Everton) header from the centre of the box is blocked. Assisted by Leighton Baines with a cross.
71:38Corner, Everton. Conceded by Federico Fernández.
69:38Corner, Everton. Conceded by Leon Britton.
66:16 SubstitutionSubstitution Substitution, Everton. Seamus Coleman replaces Bryan Oviedo.
65:22 BookingBooking Gylfi Sigurdsson (Swansea City) is shown the yellow card for a bad foul.
65:20Tom Cleverley (Everton) wins a free kick in the attacking half.
65:20Foul by Gylfi Sigurdsson (Swansea City).
64:12Attempt saved. Jack Cork (Swansea City) right footed shot from outside the box is saved in the centre of the goal.
60:58Attempt missed. Romelu Lukaku (Everton) left footed shot from outside the box misses to the left. Assisted by Gerard Deulofeu.
59:26Attempt blocked. Ross Barkley (Everton) left footed shot from outside the box is blocked. Assisted by Steven Pienaar.
58:56Attempt saved. Gylfi Sigurdsson (Swansea City) left footed shot from outside the box is saved in the top centre of the goal. Assisted by Jack Cork.
57:37Corner, Everton. Conceded by Neil Taylor.
53:54Attempt missed. Steven Pienaar (Everton) left footed shot from a difficult angle on the left is close, but misses the top left corner. Assisted by Gerard Deulofeu with a cross.
52:09Steven Pienaar (Everton) wins a free kick on the left wing.
52:09Foul by Jack Cork (Swansea City).
51:48 BookingBooking Lukasz Fabianski (Swansea City) is shown the yellow card.
51:17Foul by Ross Barkley (Everton).
51:17Ashley Williams (Swansea City) wins a free kick in the defensive half.
49:34Offside, Everton. Romelu Lukaku tries a through ball, but Leighton Baines is caught offside.
48:21Attempt saved. Wayne Routledge (Swansea City) left footed shot from the left side of the box is saved in the centre of the goal. Assisted by Ki Sung-yueng.
46:26Corner, Everton. Conceded by Neil Taylor.
45:00Second Half begins Everton 1, Swansea City 2.
45:00 +3:02 Half timeHalf Time First Half ends, Everton 1, Swansea City 2.
45:00 +1:29Ross Barkley (Everton) wins a free kick in the defensive half.
45:00 +1:29Foul by André Ayew (Swansea City).
44:28John Stones (Everton) wins a free kick in the defensive half.
44:28Foul by Wayne Routledge (Swansea City).
42:51 BookingBooking Angel Rangel (Swansea City) is shown the yellow card for a bad foul.
42:46Tom Cleverley (Everton) wins a free kick on the left wing.
42:46Foul by Angel Rangel (Swansea City).
36:59Corner, Everton. Conceded by Neil Taylor.
36:57Attempt blocked. Ross Barkley (Everton) right footed shot from the right side of the box is blocked. Assisted by Gerard Deulofeu.
34:49Attempt missed. Romelu Lukaku (Everton) right footed shot from the centre of the box is close, but misses to the left.
33:45 Goal scoredGoal! Goal! Everton 1, Swansea City 2. André Ayew (Swansea City) left footed shot from the left side of the box to the centre of the goal. Assisted by Neil Taylor.
31:59Corner, Swansea City. Conceded by Leighton Baines.
31:58Attempt blocked. Wayne Routledge (Swansea City) right footed shot from a difficult angle on the right is blocked. Assisted by Ashley Williams.
31:18Jack Cork (Swansea City) wins a free kick on the right wing.
31:18Foul by Leighton Baines (Everton).
28:45Attempt missed. Romelu Lukaku (Everton) header from the centre of the box misses to the right.
28:06Foul by Wayne Routledge (Swansea City).
28:06Leighton Baines (Everton) wins a free kick in the defensive half.
27:34 SubstitutionSubstitution Substitution, Everton. Steven Pienaar replaces Kevin Mirallas because of an injury.
27:07Delay over. They are ready to continue.
26:25Delay in match Kevin Mirallas (Everton) because of an injury.
25:35 Goal scoredGoal! Own Goal by Jack Cork, Swansea City. Everton 1, Swansea City 1.
25:34Attempt missed. Gareth Barry (Everton) left footed shot from the right side of the six yard box misses to the left. Assisted by Gerard Deulofeu with a cross following a corner.
25:13Corner, Everton. Conceded by Neil Taylor.
25:12Attempt blocked. Gerard Deulofeu (Everton) right footed shot from the right side of the box is blocked. Assisted by Leighton Baines with a cross.
24:13Attempt missed. André Ayew (Swansea City) left footed shot from outside the box is too high. Assisted by Jack Cork.
22:17Jack Cork (Swansea City) wins a free kick in the attacking half.
22:17Foul by Ross Barkley (Everton).
19:49Foul by Neil Taylor (Swansea City).
19:49Gerard Deulofeu (Everton) wins a free kick on the right wing.
18:42Offside, Everton. Leighton Baines tries a through ball, but Ramiro Funes Mori is caught offside.
18:38Attempt blocked. Kevin Mirallas (Everton) right footed shot from outside the box is blocked.
17:52Foul by Leon Britton (Swansea City).
17:52Kevin Mirallas (Everton) wins a free kick in the attacking half.
16:44 Goal scoredGoal! Goal! Everton 0, Swansea City 1. Gylfi Sigurdsson (Swansea City) converts the penalty with a right footed shot to the top left corner.
15:50Penalty Swansea City. André Ayew draws a foul in the penalty area.
15:50Penalty conceded by Tim Howard (Everton) after a foul in the penalty area.
14:39Attempt saved. Gerard Deulofeu (Everton) right footed shot from outside the box is saved in the centre of the goal. Assisted by Kevin Mirallas.
12:21Foul by Leon Britton (Swansea City).
12:21Ross Barkley (Everton) wins a free kick in the defensive half.
10:04Delay over. They are ready to continue.
10:03 SubstitutionSubstitution Substitution, Everton. Tom Cleverley replaces Muhamed Besic because of an injury.
9:24Delay in match Muhamed Besic (Everton) because of an injury.
8:04Foul by Neil Taylor (Swansea City).
8:04Gerard Deulofeu (Everton) wins a free kick in the defensive half.
3:13Muhamed Besic (Everton) hits the right post with a right footed shot from outside the box. Assisted by Romelu Lukaku.
0:00First Half begins.
0:00Lineups are announced and players are warming up.
Live data and text provided by our data suppliers