Lee Clark was the Fulham hero as he scored against his former club to virtually guarantee his club's Barclaycard Premiership status next season.
Clark had never started against Newcastle since leaving St James' Park, but was recalled to the team by Chris Coleman.
He repaid the new caretaker manager's faith by popping up on the edge of the box to hit a crisp winner with just four minutes remaining, and dent 10-man Newcastle's Champions League hopes as they suffered a third successive defeat.
Alan Shearer had headed Newcastle in front after 39 minutes with his first ever goal against Fulham but Sylvain Legwinski scored a stunning equaliser after 69 minutes - six minutes after Andy Griffin was sent off for a second booking.
After the departure of manager Jean Tigana on Thursday Fulham began a fresh start under Coleman and the players went into a huddle before kick-off in a bid to gee themselves up.
It had the desired effect as they made a very determined start, although they suffered a setback after 17 minutes as Louis Saha went off with an injury and was replaced by Elvis Hammond.
As Newcastle got into their stride they should have taken the lead after 18minutes when Craig Bellamy was released in the box by Nol Solano.
The Welshman, starting his 50th league game for the club, had only Maik Taylor to beat, but the goalkeeper stood up to him well and blocked his shot.
A minute later Bellamy felt he should have had a penalty as he skipped past Martin Djetou and crashed to the floor, but both referee Dermot Gallagher and his assistant waved play on.
Fulham deserved a goal after 26 minutes.
Jon Harley - another player recalled by Coleman - made a brilliant run down the left flank and delivered a good cross for Hammond.
The young striker placed his downward header well, but Shay Given made a great stop as he scooped the ball away from inside his far post.
Griffin picked up the game's first yellow card for a late challenge on Luis Boa Morte after 33 minutes. A minute later Taylor came to the rescue again for Fulham, saving a low drive from Shearer on the edge of the box.
But there was no stopping Shearer when Hugo Viana sent in a corner from the left and he powered home a header - which means Birmingham are the only Premiership club he has failed to score against.
It has been quite a week for Shearer, who began it by being named the Premier League's domestic player of the decade.
Newcastle were reduced to 10 men in the 63rd minute as Griffin made a rash sliding tackle on Boa Morte and received a second booking and a red card.
They responded by breaking quickly again and Kieron Dyer raced into the box only to see his effort brilliantly pushed away by Taylor to keep Fulham in the game.
It was still going to take something special for Fulham to find a way past Newcastle's defence, and Legwinski obliged with a stunning equaliser.
He was on the right flank, 30 yards from goal, when he unleashed a drive which beat Given's dive and went in off the far post.
It was Fulham's first goal for more than six hours and it lifted the Loftus Road crowd.
But the best was yet to come in a script which could have come straight out of Hollywood as Clark popped up to steal the points - and surely his team's Premiership survival.