Steve McClaren's side had led by two goals going into the final few minutes of the game, but they threw away their chance to move into top spot in the league standings.
Birmingham might have pulled level in the 22nd minute, but Jonathan Grounds fired wide from the centre of the box following a corner.
With a potential place at the Championship summit in the offing, Derby's Tom Ince gave the home crowd double reason to cheer when he grabbed a second goal with a neat finish into the bottom corner, after some enterprising play from Hughes.
Jesse Lingard tried to kill the game off with a third for the hosts when he crossed for Hughes, but he could not beat Randolph in the centre of goal.
The visitors managed to pull one back from the spot through Caddis in injury time, with the penalty setting up a tense finish at the iPro Stadium.
With just a few seconds left on the clock, Derby lost Donaldson inside the box and he headed home from a Wes Thomas cross to steal a memorable draw for Birmingham.