Rangers twice threw away the lead, given to them by Yossi Benayoun – after just 65 seconds – and Junior Hoilett, when they gifted Jamaal Lascelles and Matt Derbyshire equalisers.
But, just as their inability to defend corners looked set to cost them, late goals from Nedum Onuoha, Ravel Morrison and Bobby Zamora secured a first win in four for the hosts.
They should now at least be assured of a top-six finish, which is more than can be said for Forest after a 13th game without a win in all competitions.
Incoming manager Stuart Pearce was in the Loftus Road stands to cast his eye over the team he will inherit in the summer, but he will have been less than impressed with their start to the match.
Morrison and Hoilett combined to tee up Tom Carroll, whose shot from the edge of the area was palmed away by Karl Darlow.
Unfortunately for the Forest keeper the ball bounced straight to the lurking Benayoun who nodded it into an empty net.
Rangers’ chances of making it through the play-offs are likely to rest on leading scorer Charlie Austin’s shoulders – as did their automatic promotion hopes until he dislocated one of them in January.
On his first start since returning to fitness the striker should have been celebrating his 16th goal of the season but, lacking match sharpness, he failed to connect with Benoit Assou-Ekotto’s inviting cross in front of goal.
And Rangers, never ones to make life easy for themselves, gave away a sloppy corner in the 37th minute and then left defender Lascelles all alone at the near post to head in Henri Lansbury’s cross.
Forest were only level for five minutes, however, before a slick move involving Benayoun and Carroll ended with Hoilett dinking the ball over Darlow to put Rangers back into the lead.
But in the 73rd minute Forest were level again, and Rangers could not say they had not been warned as from another corner, Derbyshire was allowed too much room to power home his header.
The match by now could have gone either way but it swung back towards Rangers when Onuoha’s persistence in keeping the ball in play was rewarded when he tucked in Carroll’s reverse pass.
Then in stoppage time Rangers put a heavy gloss on the scoreline, Morrison slotting past Darlow before teeing up substitute Zamora for the fifth.