Rob Dickie’s late goal gave QPR a crucial win and took them back up to fourth in the Championship.
They came from behind at Kenilworth Road, where Luton went ahead when David Marshall allowed Cameron Jerome’s shot to squirm past him and into the net.
Andre Gray, playing against his former club, hauled Rangers level with a penalty 10 minutes into the second half.
Gray drew a a foul from Kal Naismith on the right of the area and then thumped in the resulting spot-kick.
And the visitors took the lead with seven minutes remaining when Chris Willock’s left-wing corner was glanced into the net by Dickie’s shoulder.
Luton were the better team in the first half and thought they had gone ahead when Elijah Adebayo slotted past Marshall after Jeff Hendrick had given the ball away.
Adebayo was adjudged to have been marginally offside before collecting Jordan Clark’s pass and the goal was disallowed.
However, luck was not on Rangers’ side when they went behind eight minutes before the interval.
Clark clearly handled before the ball was laid back to Jerome, whose tame effort should have been dealt with by stand-in keeper Marshall, who is playing in absence of the injured Seny Dieng.
Rangers, having lost their previous two matches and been beaten in four successive away games without scoring, were again below par for long spells.
But the three points is a huge boost to their play-off hopes with 10 matches of the season now remaining.
QPR: Marshall; Dickie, Dunne, Barbet; Odubajo, Field, Johansen, Hendrick (Amos 74), Wallace; Chair (Austin 60); Gray (Willock 78).
Subs not used: Mahoney, Ball, Adomah, McCallum, Dozzell.