Shola Ameobi scored his third goal of the season as Newcastle handed Harry Redknapp his first defeat as Queens Park Rangers manager.
It looked like being a frustrating day for the Magpies, who had lost six of their previous seven games, as Demba Ba and Papiss Cisse missed good chances.
But substitute Ameobi rifled in a shot with nine minutes remaining for his first league goal in nine months.
Ameobi finish was class - Pardew
QPR battled hard, with striker Djibril Cisse missing their best chance.
Rangers, who defended stoutly and looked dangerous on the counter-attack, thought they had done enough as they looked to continue their mini-revival under new manager Redknapp.
However, it was Redknapp's opposite number Alan Pardew who changed the course of the match, with two of his substitutes having a direct influence in the match-winning strike.
Sylvain Marveaux replaced Cheick Tiote with 13 minutes left, and his extra quality created the opportunity for Ameobi to collect the Frenchman's pass, cut inside and find the back of the net with a classy finish.
It justified Pardew's decision to replace Papiss Cisse with Ameobi - a substitution which caused some discontent from the stands, and plenty of frustration from the Senegalese striker. Papiss Cisse refused to shake his manager's hand as he angrily made his way to the dugout to watch the remainder of the match.
Goals, goals, goals
There has not been a Premier League goalless draw at St James' Park during the whole of 2012. The last was against Swansea in December 2011.
It capped a miserable day for the number nine, as he and his strike partner Ba struggled to break down a resolute Rangers defence expertly marshalled by Ryan Nelsen.
The one time the two did link up to good effect midway through an uninspiring first half ended with Cisse being denied by Fabio's well-timed tackle.
Ba also fired two free-kicks into the stands as Newcastle looked short on ideas without influential midfielders Yohan Cabaye and Hatem Ben Arfa.
QPR almost stunned St James' Park after the break when Adel Taarabt, who scored two goals in his side's victory over Fulham last weekend, showcased some outrageous skill to leave three defenders in his wake and slotted a pass through for Djibril Cisse. The French striker held off his marker, but his shot found the side-netting.
Newcastle were struggling for inspiration, until Pardew brought on Ameobi and Gabriel Obertan with just half an hour to go.
Redknapp hints at January deals
The change worked a treat, as the home side became much more of a threat in the final third - Ba turning and having a shot deflected over and then having a weak header saved by Rob Green.
A goal seemed inevitable, and it was no surprise when Ameobi slotted home. There was still time for the impressive Marveaux to go close with two shots that were well saved by Green, but Newcastle had done enough.
The only negative to come out of the game for the hosts was a fifth booking of the season for Tiote, which rules the midfielder out of his side's Boxing Day trip to Manchester United.
Rangers will take plenty of heart from their workmanlike performance, with defeats for their relegation rivals Reading, Wigan and Southampton meaning very little has changed in the bottom four.
Newcastle boss Alan Pardew:
"I know the crowd weren't particularly pleased when I took Cisse, a goalscorer, off but I just felt Shola, he's a big man and this was a big occasion and he likes big occasions.
"It said QPR on the programme but really it was bigger than that, I think we all knew that and he has that calm head - he knows what is demanded here - to produce a quality goal, and it won us the game.
"I wanted to get Shola on the pitch, and thank goodness I did because it was a really class finish."
QPR boss Harry Redknapp:
"I thought we were going to hang on and nick a draw. I couldn't see us winning, but we just couldn't see it through.
"I thought we could hang on for a good point to keep us going, but it just wasn't to be."
90:00+4:51 Jamie Mackie fouled by Mike Williamson, the ref awards a free kick. Shot on goal comes in from Adel Taarabt from the free
kick, save by Tim Krul.
90:00+4:22 Rob Green takes the direct free kick.
90:00+4:22 Booking Booking for Shola Ameobi.
90:00+3:41 Foul by Ryan Nelsen on Demba Ba, free kick awarded. Demba Ba takes the direct free kick.
90:00+2:55 The referee blows for offside. Tim Krul restarts play with the free kick.
90:00+2:08 Shola Ameobi is caught offside. Free kick taken by Rob Green.
90:00+1:48 Shola Ameobi takes a shot. Save by Rob Green.
90:00+0:56 Free kick awarded for an unfair challenge on Demba Ba by Ryan Nelsen. Demba Ba takes the free kick.
90:00+0:42 Clint Hill concedes a free kick for a foul on Demba Ba. Direct free kick taken by Vurnon Anita.
89:39 David Hoilett fouled by Davide Santon, the ref awards a free kick. Free kick taken by Rob Green.
88:53 Adel Taarabt is flagged offside by the assistant referee. Indirect free kick taken by Tim Krul.
87:58 Shaun Derry takes the direct free kick.
87:58 Booking James Perch is shown a yellow card for unsporting behaviour.
87:38 Foul by James Perch on Adel Taarabt, free kick awarded.
85:33 Clint Hill challenges Demba Ba unfairly and gives away a free kick. Strike on goal comes in from Sylvain Marveaux from the
85:07 Direct free kick taken by Vurnon Anita.
85:07 Booking Clint Hill receives a caution.
84:47 Free kick awarded for an unfair challenge on Demba Ba by Clint Hill.
82:09 Sylvain Marveaux takes a shot. Save made by Rob Green.
81:34 Corner taken by Adel Taarabt.
Correction - 80:11 Assist on the goal came from Sylvain Marveaux.
80:11 Assist by Vurnon Anita.
80:11 GOAL - Shola Ameobi:Newcastle 1 - 0 QPR Goal scored by Shola Ameobi from deep inside the penalty area to the bottom left corner of the goal. Newcastle 1-0 QPR.
79:00 Danny Simpson takes a shot. Clint Hill manages to make a clearance. Outswinging corner taken from the right by-line by Vurnon
77:58 Substitution Shaun Derry joins the action as a substitute, replacing Alejandro Faurlin.
76:15 Substitution Sylvain Marveaux is brought on as a substitute for Cheick Tiote.
73:17 Stephane Mbia concedes a free kick for a foul on Shola Ameobi. Free kick taken by Tim Krul.
72:27 Demba Ba takes a shot. Save by Rob Green.
70:39 Clint Hill gives away a free kick for an unfair challenge on Shola Ameobi. Demba Ba has an effort direct from the free kick,
Adel Taarabt gets a block in. Outswinging corner taken from the right by-line by Vurnon Anita.
67:53 Shola Ameobi fouled by Clint Hill, the ref awards a free kick. Tim Krul takes the direct free kick.
66:03 Header by Shola Ameobi from deep inside the penalty area misses to the left of the goal.
65:19 Demba Ba takes a shot. Ryan Nelsen gets a block in. Corner taken by Vurnon Anita played to the near post, save by Rob Green.
63:58 Vurnon Anita takes a inswinging corner from the left by-line to the near post, Rob Green manages to make a clearance.
62:57 Direct free kick taken by Anton Ferdinand.
62:57 Substitution David Hoilett replaces Djibril Cisse.
62:57 Booking Cheick Tiote goes into the book for unsporting behaviour.
62:51 Cheick Tiote challenges Shaun Wright-Phillips unfairly and gives away a free kick.
61:30 Ryan Nelsen gives away a free kick for an unfair challenge on Shola Ameobi. The free kick is delivered right-footed by Vurnon
Anita from left wing, save by Rob Green.
60:56 Free kick awarded for an unfair challenge on Fabricio Coloccini by Jamie Mackie. Direct free kick taken by Tim Krul.
59:35 Substitution Shola Ameobi is brought on as a substitute for Papiss Cisse.
59:35 Substitution Gabriel Obertan on for Jonas Gutierrez.
59:35 Header from deep inside the area by Papiss Cisse goes over the bar.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.