Wade Elliott put Blues ahead shortly after the half-hour mark, just as he had done in the initial meeting which finished 1-1 ten days ago.
But once again Leeds levelled after the break, this time courtesy of Ross McCormack’s first goal since September – an effort which had not looked like coming with 19-goal striker Luciano Becchio, a reported January transfer target for a handful of clubs, missing due to illness.
El-Hadji Diouf, celebrating his 32nd birthday, then quickly completed the turnaround, keeping his cool to chip home from the penalty spot after Paul Robinson had been penalised for handball.
It means Leeds will now host Spurs in the fourth round of the competition in a televised clash next Sunday, denying cash-strapped Birmingham the chance to pick up a welcome sum in the region of £200,000.
The first shot on target didn’t arrive until the 35th minute, as Marlon King forced Jamie Ashdown to get down low, and the hosts did not have to wait long for a deserved opener.
King fed Nathan Redmond down the right and he sent a cross to the far post which Elliott converted.
Leeds, who had failed to manage a shot on target in almost three hours of football, finally broke their duck in the 53rd minute, Rodolph Austin’s speculative effort spilled by Colin Doyle, and they went on to draw level in the 70th minute.
Paul Green’s ball into the box was pulled back by Diouf at the far post and McCormack was on hand to stroke home from eight yards.
Green’s header brought a solid save out of Doyle soon after, but the visitors did not have to wait long for a second.
Austin’s cross struck the hand of Robinson and, after much deliberation between the officials, Diouf was handed the chance to convert from 12 yards.
Nikola Zigic saw his header cleared off the line by Aidy White as the Blues pressed for an equaliser, while fellow substitute Peter Lovenkrands was denied by a superb fingertip save from Ashdown.