Cameron Jerome's fifth goal of the season had given the Town a half-time lead, but ex-Hatter Andre Gray equalised with a penalty early in the second half and Rob Dickie netted a late winner to lift the seventh-placed visitors above the Hatters into sixth.
Taking charge of his 100th match since returning to the club, manager Nathan Jones made four changes with James Shea and Kal Naismith back fit and available, the latter slotting into the back five in place of Dan Potts.
Allan Campbell joined Pelly-Ruddock Mpanzu and Jordan Clark in midfield, whilst there was a return to the starting line-up for Cameron Jerome, who partners Tuesday's match winner Elijah Adebayo up-front.
The Hatters started in the ascendancy, Campbell twice trying his luck in the opening eight minutes, the first a 25-yard skidder that Hoops keeper David Marshall got down low to save, then an angled shot after good link-up play between Naismith and Adebayo, but that one was too high.
Town suffered a blow in the 15th minute when Mpanzu was forced off after being injured in a challenge with Rangers skipper Stefan Johansen in front of the away dugout.
Shea had to make his first save on 16 minutes, pushing away a 20-yard drive from Moses Odubajo that skidded through Naismith's legs, but Town were lookg a real threat at the other end.
Adebayo had the ball in the net after some lovely combination play with Clark in the 24th minute, but the top scorer's wait for his 15th goal of the season went on after a linesman's flag was raised, correctly, for offside.
The striker was flagged offside again moments later as he steered Naismith's cross goalward, with Campbell presented with an open goal from Marshall's parry, only to head wide. The linesman's flag spared the Scot's blushes, but Town were finally in front in the 37th minute.
The ball came in from the right from Bree, Clark controlled, Campbell rolled the back and there was veteran striker Jerome to lash in from just outside the box, with Marshall getting a hand to it but unable to keep the shot out.
It might have been two a couple of minutes later when Adebayo, a constant threat to the Rangers back four, rose at the far post to meet Bree's right-wing corner, but he couldn't direct his header on target.
Rangers were lucky to end the half with 11 men after Ilias Chair was called back after the half-time whistle had been blown to be shown a yellow card by referee Josh Smith, who might well have brandished his red had he seen a replay of the QPR midfielder pushing Tom Lockyer in the face.
Town started the second half well, too, Adebayo pulling the ball back for Campbell to side-foot goalward, only for Marshall to turn it away.
The visitors were level by the 55th minute, when Gray lured Naismith into fouling him by the touchline, just inside the area. The ex-Hatters striker stepped up to convert from 12 yards and turned away without celebrating.
The Hatters went in search of a second goal, Jerome racing to the right byline and Lockyer sending a header over, just after the hour.
The goalscorer was replaced by Cornick with just over quarter-of-an-hour to go, and the substitute was at the heart of the Town's next threatening move, as he drove into the left side of the penalty area and as the ball was only half-cleared, Amari'i Bell let fly from the angle of the box, only to find the side-netting of Marshall's goal.
Rangers took the lead with eight minutes to go when Johansen's left-wing corner was flicked on by Dickie at the near post and found its way inside the net at the far.
Jones introduced Snodgrass in place of Clark, and the former Scotland international tested Marshall from 20 yards, but the Hatters couldn't find a way back into things and dropped a place to seventh.
Goals:
Luton: Jerome (37)
QPR: Gray (55 pen), Dickie (83)
Attendance: 10,073