Steven Caulker turned Raheem Sterling's attempted centre into his own net in the dying seconds to ensure the Reds triumphed in a game with three injury-time goals
Caulker's inadvertent error in the sixth minute of injury time ultimately settled a pulsating Premier League clash in Liverpool's favour, but only after a see-saw battle had produced four goals in the last nine minutes.
Chilean Eduardo Vargas - fresh from a double against Peru on international duty - looked set to grab the headlines heading into injury time.
On as a 79th-minute replacement for Bobby Zamora, the striker scored for the first time since arriving on loan from Napoli to level at 1-1, and then tied the scores again at 2-2 after Philippe Coutinho's exquisite goal had once again given Liverpool the ascendancy.
Richard Dunne had earlier put through his own net to open the scoring, in the process becoming the first player in Premier League history to score 10 own goals, but it was his team-mate Caulker whose unwanted contribution proved decisive when he turned the ball past Alex McCarthy.
The visitors had endured a difficult week which saw Raheem Sterling in the spotlight for complaining of tiredness while on England duty and Daniel Sturridge suffer another injury setback.
However, Sterling received a warm reception by both sets of supporters, having spent some time at the QPR academy before moving north, and he played a vital role in the goal that eventually won it for the visitors.
Goalkeeper McCarthy made his Premier League debut for QPR, with Robert Green suffering from tonsillitis, while Rio Ferdinand was dropped to the bench, with Dunne coming in along with Yun Suk-young and Bobby Zamora.
Liverpool made four changes, with Mario Balotelli back in for Rickie Lambert up front, while Glen Johnson and Jose Enrique returned as full-backs and Emre Can played for the first time since the end of August after recovering from an ankle injury.
QPR started brightly and almost went ahead when Charlie Austin battled past Johnson and Martin Skrtel before being denied by Simon Mignolet rushing out to save with his feet.
The hosts blew another great chance approaching the half-hour mark when Zamora broke clear down the right and pulled a fine pass back across the area, only for Leroy Fer to fire against the crossbar from eight yards out with the goal at his mercy.
Fer again hit the woodwork with a header from Zamora's cross and Johnson just managed to clear the danger as Austin and Sandro raced in to pounce on the rebound.
Liverpool showed little attacking threat throughout the first period but Steven Gerrard went close as the interval approached when curling a shot just wide of the post.
Harry Redknapp was forced to replace Nedum Onuoha with Matt Phillips during the break but QPR were straight back on the front foot as Sandro forced Mignolet to make a fine save.
Liverpool started to find more of a rhythm around the hour mark and Balotelli should have scored when McCarthy could only palm out an Adam Lallana effort, but the Italian blasted wildly over the crossbar with the rebound.
The visitors did take the lead on 67 minutes, though, when quick thinking by Sterling at a set-piece set Johnson free down the right and his low cross was turned into his own net by Dunne.
Mignolet was at full stretch to keep out a header from substitute Armand Traore and McCarthy saved a Balotelli shot with his legs as the game opened up.
QPR drew level on 87 minutes as another replacement, Vargas, was first to react to Austin's knock-back after Liverpool had failed to clear a free-kick.
But that was merely the precursor to even more late drama.
Coutinho then raced up the other end to put the visitors back in front after being played in by Gerrard, before Vargas struck again with a header two minutes into stoppage time.
However, even that was not the end of the scoring, as Sterling sprinted in behind the QPR defence and his cross was turned into his own net by a luckless Caulker.