Match ends, Everton 1, Swansea City 2.
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 makes instant impact
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 their own worst enemy
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.
Man of the match - Andre Ayew
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."
The stats you need to know
- Swansea won their first ever league match against Everton, at the 22nd attempt (D8 L13).
- Goodison Park has now seen 46 Premier League goals this season, more than any other ground.
- Tim Howard has given away the most penalties in the Premier League since August 2013 (5, level with Jose Fonte).
- The Swans picked up their first away win in six Premier League games (D1 L4).
- Francesco Guidolin emulated Michael Laudrup and Garry Monk by winning his first Premier League game in charge of the Swans.
- Four of Gylfi Sigurdsson's five Premier League goals this season have come from a set-piece situation (3 penalties, 1 direct free-kick).
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.
- 8OviedoSubstituted forColemanat 67'minutes
- 25Funes Mori
- 17BesicSubstituted forCleverleyat 11'minutes
- 11MirallasSubstituted forPienaarat 28'minutes
- 1FabianskiBooked at 52mins
- 22RangelBooked at 43minsSubstituted forNaughtonat 90+1'minutes
- 4Ki Sung-yueng
- 23G SigurdssonBooked at 66mins
- 15RoutledgeSubstituted forAmatat 77'minutes
- 10A AyewSubstituted forMacedo Lopesat 89'minutes
- 17Macedo Lopes
- Anthony Taylor
- Shots on Target
Second Half ends, Everton 1, Swansea City 2.
Attempt missed. Seamus Coleman (Everton) left footed shot from very close range is too high. Assisted by John Stones following a corner.
Attempt 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.
Corner, Everton. Conceded by Jordi Amat.
Tom Cleverley (Everton) wins a free kick on the right wing.
Foul by Leon Britton (Swansea City).
Attempt 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.
Substitution, Swansea City. Kyle Naughton replaces Angel Rangel.
Substitution, Swansea City. Eder replaces André Ayew.
Attempt 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.
Attempt 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.
Attempt blocked. Steven Pienaar (Everton) left footed shot from outside the box is blocked. Assisted by Gareth Barry.
Ross Barkley (Everton) wins a free kick in the attacking half.
Foul by Leon Britton (Swansea City).
Attempt blocked. Romelu Lukaku (Everton) left footed shot from outside the box is blocked. Assisted by Gareth Barry.
Foul by Romelu Lukaku (Everton).
Federico Fernández (Swansea City) wins a free kick in the defensive half.
Substitution, Swansea City. Jordi Amat replaces Wayne Routledge.
Attempt missed. John Stones (Everton) right footed shot from the centre of the box is close, but misses to the right following a corner.