The team which beat Arsenal on Saturday went ahead against the League One side after another deflection, when Hungarian Zoltan Gera's shot hit Leicester's Michael Morrison to beat on-loan Liverpool goalkeeper David Martin.
Yet Fulham looked floored when Paul Dickov, 35, and Andy King, 19, put Leicester in front within four minutes of the second half restart.
But Jimmy Bullard came to the rescue with a spectacular long-range strike in the 83rd minute and Murphy's even later blast finally felled the Foxes.
• Hodgson breathes sigh of relief
Fulham showed their commitment to the competition by making just one change to the team that defeated Arsenal - Stoor coming in at right-back for John Pantsil.
Although the Fulham opener after 31 minutes was lucky, the build-up was sharp, with the effervescent Bobby Zamora managing to lay the ball off from impressive Swedish new boy Fredrik Stoor's lofted pass despite the attention of two defenders, before Gera struck.
But after having the edge in an entertaining first-half battle, they were stunned by Leicester's sheer exuberance and fire which produced two goals within four minutes of the restart.
Veteran Dickov, in his second spell at the Midlands club, rammed in an equaliser in the opening minute of the second half after half-time substitute Max-Alain Gradel, from the Ivory Coast, had a shot blocked.
Zamora really should have equalised straight away when Fulham forced a corner, but he headed over the bar unchallenged from Simon Davies' flag kick.
The punishment was severe - with midfielder King taking possession just inside the area and curling a shot beyond Mark Schwarzer, an effort to challenge his 35-yard effort which won City's Goal of the Season award last term.
Fulham could not complain they had not seen the threat of a shock coming.
Leicester had started the match strongly and good work by Matt Fryatt set up Steve Howard for a rising drive from 18 yards which tested Mark Schwarzer.
Fulham replied with Zamora bursting into action, unleashing a low drive which flew just wide. Then Murphy fed Bullard whose snap shot was deflected for a corner.
Fryatt had a goalbound shot blocked at the other end soon afterwards, and it was lively fare for the small crowd of 7,584.
Busy Zamora almost reached a probing right-wing cross by Simon Davies in the 20th minute when the former West Ham striker cleverly lost his marker at the far post.
It nevertheless looked grim for the Premier League side after Leicester's stunning one-two in the second half, but Bullard, Murphy and luck saved the day late on.
Hodgson breathes sigh of reliefFulham manager Roy Hodgson knew his Premier League side had been let
off the hook after two late goals put them through to the Carling Cup third
round at the expense of League One side Leicester.
Hodgson said: 'It was more than the nerves that were being tested. From the
first half, when we were playing quite well and leading, we suddenly lost our
rhythm when going 2-1 down in just a few minutes after the start of the second.
'We were playing a very good team with their tails up and they gave us an
awful lot of problems. Thank goodness we re-found our tempo in the last 20
minutes and got through with two wonderful strikes.'
Fulham were a goal up at the interval through Zoltan Gera's deflected strike
but then fell behind soon after the break and looked to be heading for defeat
before their late salvo.
Hodgson said: 'We were not guilty of complacency. It was just that our game
went to pieces with those two goals Leicester scored but we have come out of it
with a couple of positives - one that we were able to find our game again, and
two that we learned a lot of lessons without paying the full price.'
Philosophical Leicester manager Nigel Pearson appeared to be set for a
top-flight scalp when veteran Paul Dickov and teenager Andy King struck within
three minutes of the start of the second half.
Pearson said: 'Maybe the result was a bit unfair but after all that's life.
'We should have had a penalty in the first half and then we were done by an
own goal (Gera's goal was deflected) and there was another deflection right at
the end as well, their winner.
'But I'm happy that we gave it a good go and I'm not going to moan too much.
'Give Fulham some credit, they fielded a full-strength side and I expected
that because it's nearly three weeks until their next game and this is a
competition they would like to win.'