QPR 2 Sunderland 3: Wes Brown's last-minute header earned Sunderland the victory at Loftus Road — to hand Martin O’Neill his second win in his three games as new Black Cats boss.
Sunderland were 2-0 up and in control courtesy of goals from Nicklas Bendtner and Stephane Sessegnon when slack defending allowed QPR back into the game.
The home side had been toothless for the best part of an hour but launched an unlikely comeback when Heidar Helguson bundled Alejandro Faurlin's cross into the Sunderland net.
The Icelandic striker then provided the knock-down for Jamie Mackie to level before QPR keeper Paddy Kenny kept it that way with two magnificent saves.
But Brown clinched the victory for Sunderland with a header from Keiran Richardson's corner which Faurlin could not keep out, despite his best efforts on the line.
There were no pre-match indications of the drama to come, with both sides struggling for wins and QPR the lowest scoring team in the Premier League.
After an hour it was easy to see why and manager Neil Warnock will need to sharpen QPR's cutting edge in the January transfer window if they are to move away from the relegation zone.
For Sunderland, Ulsterman O'Neill has now overseen two wins from his first three matches in charge and he elicited an immediate reaction from Bendtner.
The Danish striker and midfielder Lee Cattermole both returned to the side for the first time since being arrested on suspicion of criminal damage.
O'Neill told on-loan Bendtner the best way to impress him would be to behave himself off the pitch and score more goals on it, challenging him to “win us some football matches”.
Bendtner set the ball rolling. He had already hit the post with a stooping header from Sebastian Larsson's free-kick when he put Sunderland ahead.
The visitors counter-attacked, won a corner and Bendtner muscled past Matthew Connolly to meet Richardson's delivery from the right-hand side with a powerful near-post header.
Warnock sent on Adel Taarabt at half-time and that enlivened QPR, who came close to drawing level when Helguson's header was cleared off the Sunderland line by Titus Bramble.
But Gabbidon then misjudged a header and Sessegnon latched onto the ball and rounded Kenny to fire Sunderland 2-0 up and seemingly seal the win.
But from nowhere QPR hit back. Keiren Westwood and Brown failed to deal with Faurlin's cross and Helguson bundled it home.
Four minutes later, Helguson turned provider, heading the ball down for Mackie to score his first goal since breaking his leg in January.
But neither Kenny nor Faurlin on the line could do anything to deny Brown his winning goal, the former Manchester United defender meeting Richardson's corner and directing his header inside the far post.