Andre Gray’s brilliant winner in added time propelled QPR to third place in the championship standings.
Chris Willock’s equalizer – his third goal in his last four games – equalized after Tom Lawrence put Derby in front.
And on loan forward Gray, as a substitute, scored dramatically to give the Rangers the points.
After Ilias Chair directed Willock’s cross against the post, Gray recovered the ball and made two skillful touches before sublimating with a volley in the far corner of the net.
The Rangers have been undefeated for six games, have won three in a row and remain the only team in the division to have scored in all of their league games this season.
They have now scored in 31 consecutive league games – two short of the club’s record of 33.
Lawrence opened the scoring after just 10 minutes at Pride Park.
After Yoann Barbet gave the ball, Graeme Shimmie made a nice pass for Lawrence, who slipped between Rob Dickie and Jimmy Dunne and blasted goalkeeper Seny Dieng.
But Willock hit back for Rangers five minutes into the second half.
Charlie Austin drifted to the left, picked up Chair’s pass and threw the ball up to Willock, who flew home near the edge of the six-yard box.
The president missed a great opportunity to put QPR ahead when he managed Willock’s left wing cross from close range.
And the Rangers may have received a late penalty when Dunne’s jersey was pulled by Max Bird as the defender tried to force the ball into Chair’s corner.
But their persistence was ultimately rewarded with an emphatic style.
QPR: Dieng; Dickie, Dunne, Barbet, Adomah, Dozzell, Johansen, Wallace (Odubajo 53); President, Willock (Field 90); Austin (Gray 75).
Subs not used: Archer, Thomas, Amos, Ball.