Andre Gray’s brilliant winner in injury time took QPR up to third in the Championship table.
Chris Willock’s equaliser – his third goal in his past four games – levelled after Tom Lawrence had given Derby the lead.
And on loan-striker Gray, on as a substitute, netted in spectacular fashion to give Rangers the points.
After Ilias Chair had headed Willock’s cross against the post, Gray retrieved the ball and took two deft touches before sublimely volleying into the far corner of the net.
Rangers are unbeaten in six games, have won three in a row, and remain the only team in the division to have scored in all their league matches this season.
They have now scored in 31 consecutive league outings – two short of the club record of 33.
Lawrence opened the scoring after just 10 minutes at Pride Park.
After Yoann Barbet had given the ball away, Graeme Shimmie threaded a fine pass through for Lawrence, who sneaked between Rob Dickie and Jimmy Dunne and blasted past keeper Seny Dieng.
But Willock hit back for Rangers five minutes into the second half.
Charlie Austin drifted out to the left, collected Chair’s pass and lifted the ball towards Willock, who volleyed home from near the edge of the six-yard box.
Chair missed a great chance to put QPR ahead when he headed Willock’s left-wing cross over from close range.
And Rangers might have been awarded a late penalty when Dunne’s shirt was pulled by Max Bird as the defender tried to force the ball in following Chair’s corner.
But their persistence was eventually rewarded in emphatic style.
QPR: Dieng; Dickie, Dunne, Barbet, Adomah, Dozzell, Johansen, Wallace (Odubajo 53); Chair, Willock (Field 90); Austin (Gray 75).
Subs not used: Archer, Thomas, Amos, Ball.