Trailing to goals from Kris Commons and James Bailey at Pride Park on Saturday, Neil Warnock’s side looked beaten but substitute Patrick Agyemang scored what looked like a consolation goal in the second minute of added time.
Jamie Mackie then struck with virtually the last kick of the game to leave Derby deflated.
The Rams went into the game having lost their last three matches in all competitions since beating Leeds on the opening day of the campaign, while Rangers arrived at Pride Park with a 100% league record.
Adel Taarabt, who shone in this fixture last season, was denied by a fine save from Stephen Bywater following a mazy run early on.
Perhaps Derby had learned their lesson of almost 12 months ago as Nigel Clough used Robbie Savage to man-mark the Moroccan for long periods and that was as dangerous as he was all afternoon.
The Rams should have gone ahead after 13 minutes when Conor Doyle’s cross was deflected into the path of Savage who laid the ball off to Shaun Barker, but the big defender shot into the side-netting.
Alejandro Faurlin threatened either side of the half-hour mark but failed to work Bywater on both occasions.
Paul Green and Dean Moxey linked up well to create the opening goal for Commons after 40 minutes. The Scotland international latched on to Moxey’s pass from the left before casually lifting the ball over the advancing Paddy Kenny.
It was the first Championship goal that QPR had conceded this season.
Bailey put Derby 2-0 up just before the hour mark when he found the bottom corner with a shot from the edge of the area.
Clough’s side looked comfortable but Agyemang, a 62nd-minute replacement for Heidar Helguson, beat Barker for pace before firing the ball beyond Bywater.
Kenny kept Rangers in the game with a fine parrying save to thwart Bailey before the visitors broke and, to the amazement of everyone inside Pride Park, levelled through Mackie’s 18-yard shot in the six-minute of injury-time.