Papiss Cisse scored a dramatic stoppage-time winner as Newcastle deservedly beat Fulham to move five points clear of the relegation zone.
After hitting the post and missing a number of other chances, Cisse volleyed home with one of the game's last kicks.
Mid-table Fulham went close in either half through Dimitar Berbatov, but they were under pressure for long periods.
Vurnon Anita shot against the bar and Yoann Gouffran also hit the post before Cisse secured victory at the death.
It was the third time Newcastle had scored a stoppage-time winner in their last four Premier League games at St James' Park.
But more importantly for the Magpies, it eases relegation concerns that had intensified amid a run of three defeats in four games.
Fulham looked to have survived Newcastle's bombardment to escape with a point, only for their efforts to be undermined at the last.
While this brings to an end their three-match unbeaten run away from home, they remain in 10th place.
Martin Jol's men made the better start and Berbatov almost scored for the fifth consecutive match with a curling strike.
Newcastle's attempts to establish a rhythm was hampered when left-back David Santon limped off with a hamstring problem - Alan Pardew's latest in a long list of injury concerns.
To the manager's credit, he stuck with the 4-4-2 formation that paired Cisse and Gouffran up front, and his side managed to build a degree of momentum as Fulham offered little going forward.
Their best chances fell to Cisse, but the Senegal striker curled narrowly wide before blazing a shot over the bar.
Newcastle's profligacy seemed to give Fulham confidence and, as the first half drew to a close, it took a fine Mapou Yanga-Mbiwa block to thwart Bryan Ruiz before Tim Krul denied Stanislav Manolev.
The Magpies have conceded more second-half goals than any other Premier League side bar Aston Villa, but on this occasion they found themselves encamped inside opposition territory for long periods.
Anita - Santon's replacement - set the tone with a drive that was deflected on to the bar by Fulham substitute Emmanuel Frimpong, while Cisse was let down by a poor touch in front of goal.
They again went close when Sylvain Marveaux's corner was headed on to a post by Gouffran - it may have touched Sascha Riether arm on the way through - and Cisse hit the same upright with the follow-up.
Newcastle still looked stunned by their failure to score when Fulham went up the other end and Berbatov drew a superb diving save from Krul with a header from John Arne Riise's free-kick.
Jol introduced Hugo Rodallega and he almost made an immediate impact, only to lose his balance when seemingly clean through.
Although Newcastle flooded forward towards the end, their hopes appeared to die when Mark Schwarzer kept out a Cisse header.
However, the front man would have one last say, controlling Yohan Cabaye's shot and reacting quickest to drill past Krul.
Fulham manager Martin Jol:
"We defended well, especially in the first half. We frustrated the crowd and that's what you want away from home. We had two or three opportunities but didn't score.
"It's not easy to come here and get away with a result but today we probably should have, at least one point. It's unbelievable they [Newcastle] are in that position and a draw would have been disappointing for them.
"But if you've watched us over the last three months we've done ever so well, frustrated home teams and scored at the right moment. We didn't today and that's disappointing. Conceding late is even more disappointing.
"We've had a very good run and we said today we don't want to break that - getting a result here was our intention. We're disappointed."