Newcastle's Alexander Isak scored a dramatic stoppage-time winner at Nottingham Forest from the penalty spot to keep their hopes of a top-four finish firmly alive.
Isak, who had earlier cancelled out Emmanuel Dennis' opener in the first half, coolly placed his spot-kick into the right corner after Moussa Niakhate was penalised for handball in the box.
In an eventful encounter, Newcastle substitute Elliot Anderson thought he had made it 2-1 when he thumped in a header at the back post, only for it to be ruled out by VAR for offside in the build-up.
Newcastle were on top for large spells and hit the crossbar twice in the first half, either side of a glorious chance fired over by Joe Willock from close range.
Forest's opener came against the run of play when Newcastle defender Sven Botman unforgivably gifted possession to Dennis, who smartly chipped it over the players standing guard on the goalline.
The visitors' pressure eventually paid off when Willock set-up Isak for a precise volley into the far corner on the stroke of half-time and the Swedish striker later delivered the winner to spark celebratory scenes in the away end in Nottingham.
The result leaves Newcastle just a point behind Tottenham in fifth - and still with a game in hand - while Forest remain two points above the relegation zone.
Newcastle's effort pay off as Forest woes continue
Newcastle were made to work hard for their victory but it was well deserved.
They had already forced Forest goalkeeper Keylor Navas into action on numerous occasions in the second half as pressure grew inside the hosts' half, while defender Serge Aurier made a goalline clearance and striker Jacob Murphy volleyed wide from close range.
Luck appeared to be on Forest's side when Anderson's goal was ruled out for offside in the build-up, but Newcastle were eventually rewarded for their endeavour as Isak stepped up again to deliver the goods.
It was the first time this season Newcastle had come from behind to win in the Premier League and it strengthens their challenge for a Champions League qualification spot.
It was also another impressive showing from Isak, who now has six goals in 10 Premier League appearances after also netting in the 2-1 win over Wolves last weekend.
For Forest it was another disappointing result. The danger of relegation remains and they were not a match for Newcastle on Friday evening.
How to play
Rate players out of 10 throughout or after the game. The rater will close 30 minutes after the final whistle.
Rating range key1 = Give it up10 = Pure perfection
Squad number12Player nameNavas
Squad number24Player nameAurier
Squad number38Player nameFelipe
Squad number19Player nameNiakhaté
Squad number32Player nameRenan Lodi
Squad number22Player nameYates
Squad number6Player nameShelvey
Squad number20Player nameJohnson
Squad number10Player nameGibbs-White
Squad number25Player nameDennis
Squad number34Player nameA Ayew
Squad number7Player nameN Williams
Squad number16Player nameSurridge
Squad number23Player nameFreuler
Squad number31Player nameGustavo Scarpa
Squad number22Player namePope
Squad number2Player nameTrippier
Squad number5Player nameSchär
Squad number4Player nameBotman
Squad number33Player nameBurn
Squad number36Player nameS Longstaff
Squad number39Player nameBruno Guimarães
Squad number28Player nameWillock
Squad number23Player nameMurphy
Squad number14Player nameIsak
Squad number10Player nameSaint-Maximin
Squad number11Player nameRitchie
Squad number32Player nameAnderson
Formation 4-2-3-112NavasBooked at 90mins24Aurier38Felipe19Niakhaté32LodiBooked at 90mins22YatesSubstituted forFreulerat 58'minutes6ShelveyBooked at 90minsSubstituted forFurtado Scarpaat 90+4'minutes20Johnson10Gibbs-WhiteBooked at 59mins25DennisBooked at 22minsSubstituted forN Williamsat 79'minutes34A AyewSubstituted forSurridgeat 79'minutes
Substitutes4Worrall7N Williams8Colback13Hennessey15Toffolo16Surridge23Freuler28dos Santos de Oliveira31Furtado Scarpa
Formation 4-3-322Pope2Trippier5Schär4Botman33BurnBooked at 33mins36S Longstaff39Bruno Guimarães28Willock23MurphySubstituted forRitchieat 84'minutes14Isak10Saint-MaximinSubstituted forAndersonat 45'minutes
Match ends, Nottingham Forest 1, Newcastle United 2.
Second Half ends, Nottingham Forest 1, Newcastle United 2.
Alexander Isak (Newcastle United) wins a free kick on the left wing.
Foul by Gustavo Scarpa (Nottingham Forest).
Renan Lodi (Nottingham Forest) is shown the yellow card for a bad foul.
Alexander Isak (Newcastle United) wins a free kick on the right wing.
Foul by Renan Lodi (Nottingham Forest).
Substitution, Nottingham Forest. Gustavo Scarpa replaces Jonjo Shelvey.
Goal! Nottingham Forest 1, Newcastle United 2. Alexander Isak (Newcastle United) converts the penalty with a right footed shot to the top right corner.
Keylor Navas (Nottingham Forest) is shown the yellow card.
Jonjo Shelvey (Nottingham Forest) is shown the yellow card.
Penalty conceded by Moussa Niakhaté (Nottingham Forest) with a hand ball in the penalty area.
Attempt blocked. Alexander Isak (Newcastle United) header from the centre of the box is blocked. Assisted by Joe Willock with a cross.
Nick Pope (Newcastle United) wins a free kick in the defensive half.
Foul by Sam Surridge (Nottingham Forest).
Attempt saved. Brennan Johnson (Nottingham Forest) right footed shot from the right side of the box is saved in the bottom right corner.
Attempt blocked. Bruno Guimarães (Newcastle United) right footed shot from the centre of the box is blocked. Assisted by Matt Ritchie with a cross.
Kieran Trippier (Newcastle United) wins a free kick in the defensive half.
Foul by Neco Williams (Nottingham Forest).
Substitution, Newcastle United. Matt Ritchie replaces Jacob Murphy.
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