Alexander Isak scored an 89th-minute winner after Aleksandar Mitrovic’s penalty for Fulham was disallowed as Newcastle returned to third in the Premier League.
Club record signing Isak, on his first league appearance since September after injury, tapped home from close range at a jubilant St James’ Park.
Mitrovic looked to have given Fulham the lead against his former team, but his spot-kick was ruled out because he accidentally kicked the ball on to his standing foot when he slipped.
It was a dramatic final 30 minutes to a tight game which Newcastle edged without being able to create clear chances.
In the end Isak, who made a promising start to life on Tyneside before his injury, was in the right place to convert strike partner Callum Wilson’s knock-back.
Fulham manager Marco Silva was booked for protesting after the final whistle, with his side unfortunate to see their five-game winning run ended.
Isak delivers for Newcastle
Newcastle are now one point behind second-placed Manchester City.
They have a five-point buffer over Tottenham as they continue their unexpected push for Champions League qualification, although Spurs will cut it to two if they beat leaders Arsenal later on Sunday.
Sweden striker Isak, a £60m signing last summer, scored twice in his first three games before being sidelined by a thigh injury.
Here he was sent on in the 71st minute and only had two touches in the Fulham box, one of which proved pivotal.
Newcastle had hit the post through a Fabian Schar free-kick in the second half but, without midfielder Bruno Guimares – who left the field in tears at half-time because of injury – they had been kept at arm’s length by an impressive Fulham.
Newcastle registered a fifth successive clean sheet in the Premier League for the first time, and an unbeaten run of 14 games is their joint best in the top flight.
The wave of optimism on Tyneside, boosted further by securing a first cup semi-final in 18 years on Tuesday, shows little sign of dying down.