Cardiff were forced to make four changes from the side that beat Bristol City mainly through injuries and illness. Gavin Rae, Aaron Wildig and Aaron Matthews were all unfit, while Anthony Gerrard escaped his one-match suspension to displace Gabor Gyepes at the centre of defence.
The visitors pushed the Bluebirds back in the opening stages and Martyn Waghorn and Dany N'Guessan both blasted high and wide when well placed.
Clever play by Jay Bothroyd won Cardiff's first corner after 15 minutes and Joe Ledley had the ball in the net only to be whistled up for offside.
The Bluebirds were not to be denied and when Ledley passed out wide to Michael Chopra in the 17th minute, his pinpoint cross was met by a diving Bothroyd who headed into the roof of the net for his eighth goal of the season.
A free-kick by Paul Gallagher led to an equaliser for the Foxes in the 34th minute. His high ball into the danger area was met by a glancing header from Michael Morrison to wrongfoot David Marshall in the home goal.
Five minutes later the Foxes went ahead when a Waghorn through ball was met by N'Guessan who muscled past Paul Quinn before prodding home from close range.
There were no changes at the interval and Leicester came out strongly forcing the Bluebirds back on defence.
In a rare breakaway on the hour, a Chopra shot was beaten out by Chris Weale to Ross McCormack but he was unable to keep his snap shot down.
Chris Burke replaced Quinn in the 61st minute with Darcy Blake switching to full-back.
City levelled in the 72nd minute from a set-piece. Blake won a free-kick wide on the right and Peter Whittingham fired over a deep cross that went straight into the Leicester net to make it a staggering 17 goals for the midfielder.
Marshall made a superb double save from a Leicester corner with ten minutes remaining and in the goalmouth scramble that followed, Bothroyd was injured and needed treatment.
Just as a replay looked likely, Burke popped up to drive home in the 90th minute and the cheers had hardly died down when McCormack was on hand to net his first goal of the season to put Cardiff in the fifth round draw.
Cardiff City Official Website
Leicester Official Website