Alex Iwobi's 99th-minute goal earned Everton a massive victory in their fight against relegation as they held on to beat Newcastle despite being reduced to 10 men.
An average game, which was delayed by a protestor tying himself to a goalpost by his neck, came to life late on when Allan was sent off with seven minutes remaining for taking out Newcastle substitute Allan Saint-Maximin.
Referee Craig Pawson consulted the pitchside monitor and overturned his initial decision to book the Everton midfielder.
At that stage, and with 14 minutes of stoppage time to play because of the protest, hanging on for a draw looked like the best Frank Lampard's side could achieve.
Yet in the ninth minute of additional time, substitute Dominic Calvert-Lewin lead a breakaway and slipped Iwobi through before he found the bottom corner.
It led to wild celebrations at Goodison Park as Everton earned only their second win in 13 Premier League games to put three points between them and the relegation zone.
But, as Lampard and his players hugged each other in delight at the final whistle, it felt like a victory worth much more than three points as they consigned Newcastle to a second consecutive defeat.
Everton overturn poor form with galvanising win
The last time these two teams played each other on 8 February, Newcastle were in the bottom three and four points behind Everton in Lampard's first league game in charge.
But victory at St James Park and a golden period for Eddie Howe's side has propelled them to a point where it is Everton who are threatened with the drop.
This win, however, could act as a galvanising force for a team which has struggled for form and for most of this match showed themselves as a side bereft of confidence.
The fact the hosts were able to overturn what looked like a harsh decision on Allan will be all the more pleasing for Lampard and his team as they celebrated wildly with their fans as Pawson blew for full-time.
It was a pulsating end to an otherwise average encounter where supporters were reduced to cheering tackles and interceptions.
By contrast, Newcastle, with Joelinton back in the side, were a well-drilled unit and Bruno Guimaraes, making only his third start since joining the club in January, made them tick at the base of the midfield.
The visitors had the better of the first half as Chris Wood headed over and straight at Asmir Begovic, who started in goal in place of the ill Jordan Pickford.
And while Ben Godfrey had an early header saved by Martin Dubravka, Everton, who were also without Donny van de Beek, struggled to find any rhythm. Their half was summed up when the effervescent Gordon missed a kick on the edge of the area.
The second half took a bizarre twist when a protestor tied himself to a goalpost at the Gwladys Street End, which led to an eight-minute delay.
But the break did not lead to an improvement as Demarai Gray shot wide and Guimaraes then mis-hit a shot which was saved before the game turned in Newcastle's favour with Allan was sent off just as his team were in the ascendancy.
Anthony Gordon had tested Dubravka with a curling effort, with Seamus Coleman appealing for a penalty shortly afterwards.
But as Newcastle broke away Allan took out Saint-Maximin, which led to a booking, which was soon overturned as Pawson was directed to the monitor by the video assistant referee Stuart Attwell.
That led to a feeling of acrimony inside Goodison, in tune with Everton's recent form.
The late reprieve and the host's ability to hold on as Newcastle pressed for an equaliser, turned the mood on its head, however.
Lampard will hope it can now lead to his team's Premier League survival.
Player of the match
IwobiAlexander Iwobi
Everton
Squad number17Player nameIwobi
Squad number9Player nameCalvert-Lewin
Squad number24Player nameGordon
Squad number15Player nameBegovic
Squad number23Player nameColeman
Squad number22Player nameGodfrey
Squad number14Player nameTownsend
Squad number4Player nameHolgate
Squad number16Player nameDoucouré
Squad number21Player nameAndré Gomes
Squad number5Player nameKeane
Squad number11Player nameGray
Squad number7Player nameRicharlison
Squad number6Player nameAllan
Newcastle United
Squad number39Player nameBruno Guimarães
Squad number33Player nameBurn
Squad number13Player nameTargett
Squad number7Player nameJoelinton
Squad number21Player nameFraser
Squad number1Player nameDúbravka
Squad number5Player nameSchär
Squad number28Player nameWillock
Squad number24Player nameAlmirón
Squad number17Player nameKrafth
Squad number20Player nameWood
Squad number10Player nameSaint-Maximin
Squad number19Player nameManquillo
Squad number23Player nameMurphy
Line-ups
Everton
Formation 4-2-3-1
15Begovic
23Coleman4Holgate5Keane22Godfrey
16Doucouré6Allan
17Iwobi24Gordon11Gray
7Richarlison
15Begovic23Coleman4Holgate5Keane22Godfrey16Doucouré6AllanBooked at 83mins17Iwobi24GordonBooked at 76minsSubstituted forTownsendat 90+15'minutes11GraySubstituted forCalvert-Lewinat 76'minutes7RicharlisonBooked at 64minsSubstituted forAndré Gomesat 88'minutesSubstitutes
3Patterson9Calvert-Lewin14Townsend19Mykolenko21André Gomes31Lonergan33Rondón36Alli53TyrerNewcastle
Formation 4-3-3
1Dúbravka
17Krafth5Schär33Burn13Targett
28Willock39Guimarães Rodriguez Moura7Joelinton
24Almirón20Wood21Fraser
1Dúbravka17KrafthBooked at 76minsSubstituted forManquilloat 90+3'minutes5Schär33Burn13Targett28Willock39Guimarães Rodriguez Moura7Joelinton24AlmirónSubstituted forSaint-Maximinat 71'minutes20Wood21FraserSubstituted forMurphyat 85'minutesSubstitutes
3Dummett6Lascelles10Saint-Maximin11Ritchie19Manquillo23Murphy26Darlow34Gayle36S LongstaffLive Text
Match ends, Everton 1, Newcastle United 0.
Second Half ends, Everton 1, Newcastle United 0.
Substitution, Everton. Andros Townsend replaces Anthony Gordon.
Corner, Newcastle United. Conceded by Ben Godfrey.
Attempt missed. Fabian Schär (Newcastle United) right footed shot from outside the box is high and wide to the right. Assisted by Allan Saint-Maximin.
Goal! Everton 1, Newcastle United 0. Alexander Iwobi (Everton) left footed shot from the centre of the box to the centre of the goal. Assisted by Dominic Calvert-Lewin.
Attempt missed. Allan Saint-Maximin (Newcastle United) header from the left side of the six yard box is close, but misses to the left. Assisted by Jacob Murphy with a cross.
Attempt blocked. Bruno Guimarães (Newcastle United) right footed shot from outside the box is blocked.
Attempt blocked. Joelinton (Newcastle United) right footed shot from outside the box is blocked. Assisted by Allan Saint-Maximin.
Substitution, Newcastle United. Javier Manquillo replaces Emil Krafth.
Attempt blocked. Dan Burn (Newcastle United) right footed shot from the centre of the box is blocked.
Attempt missed. Fabian Schär (Newcastle United) left footed shot from a difficult angle on the left misses to the right. Assisted by Matt Targett with a cross following a corner.
Corner, Newcastle United. Conceded by Asmir Begovic.
Attempt saved. Joseph Willock (Newcastle United) right footed shot from the right side of the box is saved in the bottom right corner. Assisted by Jacob Murphy.
Attempt missed. Bruno Guimarães (Newcastle United) right footed shot from outside the box is close, but misses to the right.
Substitution, Everton. André Gomes replaces Richarlison.
Joelinton (Newcastle United) wins a free kick on the left wing.
Foul by Abdoulaye Doucouré (Everton).
Substitution, Newcastle United. Jacob Murphy replaces Ryan Fraser.
Allan (Everton) is shown the red card.
Our coverage of your Premier League club is bigger and better than ever before - here's everything you need to know to make sure you never miss a moment