Tom Ince secured Derby a dramatic 2-1 win over Birmingham as Gary Rowett's side won on his first return to St Andrew's.
It was a cruel blow for Birmingham as they had dominated long spells with a battling performance only to be thwarted by Ince and they remain on the fringes of the Sky Bet Championship relegation zone.
Rowett, dismissed by Birmingham and replaced by Gianfranco Zola, has steered his new side to four games unbeaten and Derby claimed an early lead against his old club. Jacob Butterfield's shot came back off the post and the ball went in off goalkeeper Tomasz Kuszczak.
Battling Birmingham hit back with a fully deserved 63rd minute equaliser from Che Adams but they suffered a late blow as Ince netted the winner in injury time.
Birmingham recalled Paul Robinson, Lukas Jutkiewicz and David Davis following the 3-1 midweek defeat at Brighton but they made a disastrous start and were trailing after only two minutes and 45 seconds.
Ince claimed possession on the byline and pulled a low ball into the path of Butterfield who crashed in a drive against the post but it rebounded onto the back of Kuszczak and into the net.
Jutkiewicz, who was always a problem for the Derby defence, gave an indication of Birmingham's determination when he attempted a scissors kick only to see his effort blocked by Chris Baird.
Birmingham tried unsuccessfully to get back on level terms with Jutkiewicz's clever angled chip posing a problem for Scott Carson who desperately fingered the cross away for a corner. Jutkiewicz forced the ball into the net from the corner but the goal was disallowed for a foul on Carson.
Kuszczak then had to distinguish himself with another excellent save to keep out a David Nugent effort that had been set up with great skill by Butterfield. The Birmingham keeper then did well to keep out an effort from Johnny Russell.
Birmingham's persistence paid off when they finally equalised in the 63rd minute. They were on top for long spells and a Craig Gardner corner could not be cleared by Derby and Adams was on hand to force the ball home.
With Birmingham seeking the winning goal a long clearance from Carson was picked up by the talented Ince who clipped the ball into the net to secure a dramatic victory for Derby.
Birmingham boss Gianfranco Zola:
"The result was almost impossible to take. It was very painful considering we scored a fair goal and had a penalty which was not given. But we came back and looked like winning but to lose a game in this manner was very difficult.
"We have to understand that in a season of adversity we cannot lose our concentration for a second. I warned the players that the only way Derby could cause us a problem was from set-pieces and corners.
"Everyone was aware of this but in the last minute we went looking for the winner and it was Derby who scored the vital second goal."
Derby boss Gary Rowett:
"It was a difficult game for everyone, certainly from my point of view. If I am really honest I didn't want this game because there was so much focus on me coming back.
"We stated well but then became a little sloppy. When it was 1-1 I could not have complained but the only real moment of quality in what was a poor game when Scott Carson spotted Tom Ince.
"They switched off in the last minute. It was a wonderful ball from Carson. Ince gambled and scored. This is where we have the quality. We showed it then but we will have to be better if we are to win more games."