Dominic Ball's stunning stoppage-time strike gave QPR a 3-2 victory over Cardiff – their first win in eight matches.
Joe Ralls scored twice as Cardiff came back from 2-0 down to level with five minutes remaining.
But Ball, on as a substitute, blasted home from 25 yards to end Rangers' miserable run in emphatic fashion.
First-half goals from Ilias Chair and Todd Kane put QPR 2-0 before Ralls' penalty soon after the interval brought Cardiff back into the game.
After the Bluebirds were awarded a second penalty, Ralls followed up to score from the rebound after his spot-kick was saved by goalkeeper Seny Dieng.
That looked like preserving Cardiff's unbeaten away league record this season, but Ball netted a fabulous winner to give his side the points.
QPR swapped their traditional blue and white hoops for a red and white shirt in the style of the away kit worn by the club's 1975-76 team, who were pipped to the title by Liverpool.
The kit has been produced to mark the 45th anniversary of Rangers' best-ever season.
The likes of Stan Bowles and Gerry Francis, who starred in that team, would have been proud of the two goals scored in a one-sided opening 45 minutes.
A fantastic save by Alex Smithies, playing against his former club, had prevented Adomah putting QPR ahead after just three minutes.
Adomah was set up by Lyndon Dykes' reverse pass but Smithies dived to his right to push away the winger's shot.
Rangers, without a goal in their previous four matches, took the lead after 15 minutes.
Albert Adomah collected Tom Carroll's clever pass and turned away from Joe Bennett before crossing from the right towards Chair, whose volley bounced up off the ground and into the far corner of the net.
However, Smithies could do nothing about Chair's opener nor Kane's 27th-minute volley with the outside of the right boot.
Chair did superbly on the left and directed the ball back for Kane, who fired home from near the edge of the penalty area.
Chair caused Cardiff's defence major problems but missed a great chance to make it three just before half-time, shooting wide of the target after being teed up by the recalled Bright Osayi-Samuel following a Rangers counter-attack.
Had that gone in, the second half would have been more comfortable for the hosts, who were pegged back four minutes into the second half by Ralls' coolly-taken spot-kick after Yoann Barbet had clumsily brought down Kieffer Moore.
A handball by Conor Masterson as the defender challenged Moore in the air led to Ralls' second.
QPR seemed out of ideas but hit back with only the third goal of Ball's career.