A stirring QPR performance helped their Premier League survival hopes, while heightening a beaten Sunderland's own relegation fears.
The Black Cats took the lead when striker Steven Fletcher turned in a low Adam Johnson cross.
But Loic Remy pounced on a fortunate deflection to deservedly equalise by angling in a shot past Simon Mignolet.
Andros Townsend scored with a 22-yard strike and Jermaine Jenas added a third late on to seal the three points.
The scenes of joy at the final whistle illustrated a renewed sense of optimism at QPR, while the performance provided evidence of a defensive resilience allied to a new-found ability to score goals.
The R's had four points from 13 games when manager Harry Redknapp took over but have since collected 19 from 16 games and, while they remain bottom of the table and four points from safety, the belief that they can avoid relegation is growing.
Victory saw QPR achieve back-to-back top-flight wins for the the first time since December 1995 and, more importantly, made the relegation picture look a good deal tighter.
Sunderland will certainly be looking over their shoulder. Having not won in six league games they are now only six points from the relegation zone.
"QPR played so well at times. There were good performances all round and good work rate. They thoroughly deserved this one."
For the home side, in the week the club announced financial results showing debts of £89m, the pressure to avoid relegation was clearer than ever.
Nevertheless, Rangers, and Junior Hoilett in particular, did not let this inhibit them. The winger jinked his way into the area before angling a shot a whisker wide and was soon on the attack again, cutting inside and hitting a shot that again swerved wide.
The visitors had struggled to work any chances in the opening 20 minutes but stunned Loftus Road when Fletcher scored from a swift counter-attack for his 11th goal of the season.
Townsend's free-kick for the hosts was spilled by Black Cats keeper Mignolet, and after Titus Bramble cleared upfield, Stephane Sessegnon found Johnson, who drilled a ball in for Fletcher to turn home from six yards.
- Steven Fletcher has scored seven opening goals in the Premier League this season, more than any other player.
- Jermaine Jenas scored his first Premier League goal since September 2009.
- QPR scored as many goals in this game as in their previous seven Premier League home games.
If that was harsh on QPR, they had a slice of fortune to thank for their equaliser, when Townsend's shot deflected off defender John O'Shea straight into the path of Remy, who sidefooted in for his third goal in five games.
It was QPR's first league goal at Loftus Road since Boxing Day and the team with the worst home goalscoring record in the Premier League soon threatened more.
Zamora cushioned a header into the path of Remy but he volleyed wildly over, before Stephane Mbia had a long-range shot gathered at the second attempt by Mignolet.
QPR had failed to replicate their first-half form after the interval but Townsend, a January loan signing from Tottenham, sparked them back into life when he put the home side in front with 20 minutes to go.
The midfielder chested down a clearance and half-volleyed a dipping shot into the top corner out of Mignolet's reach.
Substitute Jenas, another January arrival from Spurs, completed the west London side's victory when he produced a scorching shot to beat Mignolet in the final minute.
Sunderland manager Martin O'Neill: "We need to start winning, really. I think next week [against Norwich] is a big, big game for us.
"We have difficult fixtures coming up, including Norwich. We have our work cut out. We have known that since the start of the season.
"It has been tough going throughout the season and we have to fight through these last nine games."
Live Text Commentary
Full Time The referee signals the end of the game.90:00 +4:50
Inswinging corner taken from the right by-line by Adam Johnson, Rob Green makes a save.90:00 +1:06
Steven Fletcher challenges Clint Hill unfairly and gives away a free kick. Rob Green takes the direct free kick. Jamie Mackie takes a shot. Save made by Simon Mignolet. David Vaughan fouled by Andros Townsend, the ref awards a free kick. Sebastian Larsson takes the direct free kick. Steven Fletcher takes a shot. Save made by Rob Green.89:28
Andros Townsend provided the assist for the goal.89:28 Goal scored
Goal! - Jermaine Jenas - QPR 3 - 1 Sunderland Jermaine Jenas grabs a goal from outside the penalty box to the bottom right corner of the goal. QPR 3-1 Sunderland.88:41
Jose Bosingwa decides to take the corner short.86:15
Unfair challenge on Jermaine Jenas by Sebastian Larsson results in a free kick. Rob Green takes the direct free kick.83:38
Corner from the right by-line taken by Jose Bosingwa, Christopher Samba has a header from inside the six-yard box and clears the crossbar.82:30
Corner taken by Sebastian Larsson played to the near post, Clint Hill makes a clearance.80:55
Jamie Mackie fouled by Titus Bramble, the ref awards a free kick. Shot comes in from Jose Bosingwa from the free kick.79:07
Jose Bosingwa takes the free kick.79:07 Substitution
Substitution Phil Bardsley is brought on as a substitute for Jack Colback.79:07 Substitution
Substitution Jermaine Jenas joins the action as a substitute, replacing Loic Remy.79:07
Jack Colback challenges Shaun Wright-Phillips unfairly and gives away a free kick.76:50 Substitution
Substitution David Hoilett leaves the field to be replaced by Shaun Wright-Phillips.76:50
Corner taken left-footed by Adam Johnson to the near post, Jamie Mackie manages to make a clearance.76:50 Substitution
Substitution David Vaughan on for Alfred N'Diaye.72:32 Substitution
Substitution Jamie Mackie replaces Bobby Zamora.71:33
Fabio Da Silva takes the free kick.71:33 Booking
Booking Caution for Craig Gardner.
Free kick awarded for a foul by Craig Gardner on David Hoilett.69:58
David Hoilett provided the assist for the goal.69:58 Goal scored
Goal! - Andros Townsend - QPR 2 - 1 Sunderland Andros Townsend gets on the score sheet with a goal from outside the box to the bottom left corner of the goal. QPR 2-1 Sunderland.69:09
Andros Townsend fouled by Danny Rose, the ref awards a free kick. The free kick is swung in right-footed by Jose Bosingwa, save by Simon Mignolet.67:52
Outswinging corner taken from the left by-line by Adam Johnson.66:03
Andros Townsend takes a shot. John O'Shea gets a block in.64:00
Sebastian Larsson challenges David Hoilett unfairly and gives away a free kick. Direct free kick taken by Fabio Da Silva.62:48
Christopher Samba challenges Titus Bramble unfairly and gives away a free kick. Simon Mignolet takes the direct free kick.62:08
Foul by Danny Rose on Andros Townsend, free kick awarded. Jose Bosingwa restarts play with the free kick.60:07
Direct free kick taken by Jose Bosingwa.60:07 Booking
Booking The referee cautions Alfred N'Diaye for unsporting behaviour.59:50
Loic Remy fouled by Alfred N'Diaye, the ref awards a free kick.56:31 Substitution
Substitution Danny Rose comes on in place of Danny Graham.55:37
Outswinging corner taken left-footed by Adam Johnson played to the near post, clearance made by Clint Hill.53:27
Stephane Sessegnon produces a left-footed shot from just outside the box that goes wide left of the goal.50:11
Free kick awarded for an unfair challenge on Jose Bosingwa by Jack Colback. Jose Bosingwa restarts play with the free kick.46:40
Shot from just outside the box by Adam Johnson misses to the right of the target.45:01
The referee gets the second half started.45:00 +1:04 Half time
Half Time The players leave the pitch at half time.44:02
Foul by Alfred N'Diaye on Andros Townsend, free kick awarded. Direct free kick taken by Jose Bosingwa.39:20
Corner taken by Jose Bosingwa played to the near post, John O'Shea makes a clearance.37:27
Stephane Mbia takes a shot. Save by Simon Mignolet.35:53
Alfred N'Diaye challenges Bobby Zamora unfairly and gives away a free kick. Stephane Mbia takes the direct free kick.34:43
Inswinging corner taken by Jose Bosingwa from the left by-line, Simon Mignolet makes a save.33:35
Effort on goal by Loic Remy from deep inside the area goes harmlessly over the bar.32:58
Loic Remy takes a shot. Save by Simon Mignolet.30:54
Free kick awarded for a foul by Stephane Mbia on Alfred N'Diaye. John O'Shea restarts play with the free kick.29:24
Andros Townsend provided the assist for the goal.29:24 Goal scored
Goal! - Loic Remy - QPR 1 - 1 Sunderland Loic Remy finds the net with a goal from inside the penalty area to the bottom left corner of the goal. QPR 1-1 Sunderland.29:20
Andros Townsend takes a shot. Blocked by John O'Shea.27:34
Free kick awarded for an unfair challenge on David Hoilett by Craig Gardner. Direct free kick taken by Fabio Da Silva.26:28
Danny Graham produces a header from inside the six-yard box that clears the bar.24:46
Sebastian Larsson concedes a free kick for a foul on Andros Townsend. Stephane Mbia takes the direct free kick.23:58
Effort on goal by Stephane Mbia from outside the penalty box goes harmlessly over the bar.20:47
Free kick awarded for an unfair challenge on Ji-Sung Park by Sebastian Larsson. Jose Bosingwa delivers the ball from the free kick right-footed from left channel, Jack Colback makes a clearance.19:23
Assist by Adam Johnson.19:23 Goal scored
Goal! - Steven Fletcher - QPR 0 - 1 Sunderland Steven Fletcher scores a goal from close range to the bottom left corner of the goal. QPR 0-1 Sunderland.18:23
Bobby Zamora fouled by John O'Shea, the ref awards a free kick. The free kick is swung in left-footed by Andros Townsend, Simon Mignolet makes a save.17:16
Alfred N'Diaye has an effort at goal from outside the penalty area missing to the wide left of the goal.16:19
Free kick awarded for a foul by Jack Colback on Ji-Sung Park. Jose Bosingwa takes the direct free kick.9:43
Effort from outside the penalty box by David Hoilett goes wide right of the goal.8:24
Effort on goal by Andros Townsend from outside the box goes harmlessly over the bar.5:39
David Hoilett fouled by Stephane Sessegnon, the ref awards a free kick. Direct free kick taken by Rob Green.4:51
Loic Remy gives away a free kick for an unfair challenge on Alfred N'Diaye. Simon Mignolet takes the direct free kick.3:16
Shot by David Hoilett from deep inside the penalty area misses to the right of the goal.1:54
John O'Shea challenges Stephane Mbia unfairly and gives away a free kick. Jose Bosingwa restarts play with the free kick.1:32
Sebastian Larsson takes a shot. Blocked by Ji-Sung Park.0:00
The referee gets the match started.
Live data and text provided by our data suppliers