The hosts found themselves behind in the 10th minute thanks to David Cotterill's stunning strike but they equalised six minutes before half-time through Andy King.
Chances for a Leicester winner went begging in the second half and Pearson opted to bring on N'Guessan and Kermorgant with 15 minutes remaining.
The switch paid dividends with just a minute of normal time to go when Kermorgant nodded Ryan McGivern's free-kick back across goal and N'Guessan thumped a header past Swans goalkeeper Dorus de Vries.
Pearson said: "I always emphasise it is a squad game and I thought the substitutes did very well for us when they came on.
"Paul Gallagher was excellent when he went on and of course our French connection did very well when they went on.
"It's nice to have players like that to put on when you want to do something different."
Pearson admitted that City had at first struggled against a Swansea side who showed plenty of ambition.
He said: "It was a tough game. We were better in the second half after we had got to grips with their system.
"They are a decent side and we had to change somewhat to win the game. We had to press them higher in the pitch to affect the quality of their passing."
Cotterill gave the Foxes an early fright when he picked the ball up in midfield and unleashed a 30-yard thunderbolt into the top left corner of Chris Weale's net.
De Vries kept Swansea ahead with a superb double save on 28 minutes when he first beat away King's goalbound shot and was then quickly on his feet to block Matt Oakley's follow-up effort.
The East Midlanders levelled on 39 minutes when Matty Fryatt held up the ball before feeding Wales' international King who drilled home from 18 yards.
De Vries was then Swansea's saviour again on 68 minutes when he tipped over an angled shot from Fryatt, before the introduction of N'Guessan and Kermorgant proved decisive.
The Foxes needed a win to avoid a fixture pile-up, having already had two games frozen off over the festive period.
Pearson added: "It was a good outcome and I'm glad we haven't got another fixture to cram in."
Swansea manager Paulo Sousa revealed after the game that five of his players - Leon Britton, Ashley Williams, Nathan Dyer, Andrea Orlandi and Federico Bessone - were all unavailable because of illness.
The Portuguese boss said: "Today was the best 11 we could have put out. Those we left out all had the flu.
"I'm down because I'm out of the cup. It's a prestigious competition and brings money into the club."
The Swans boss singled out Cotterill for special praise for his stunning strike.
Sousa added: "It was a great strike from David Cotterill. We work hard to score goals from outside the box and it is something we need to do more often."