Swansea had raced into a ninth-minute lead with a stunning strike from David Cotterill.
There appeared little danger when the left winger picked up the ball in midfield.
But after weighing up his options, Cardiff-born Cotterill took two strides forward and unleashed a 30-yard thunderbolt into the top left corner of Chris Weale's net.
Weale then stopped Swansea from doubling their lead when he dived to his left to smother a Gorka Pintado drive.
Dorus de Vries kept the visitors ahead with a superb double save on 28 minutes when he first beat away Andy King's goalbound shot and was then quickly on his feet to block Matty Oakley's follow-up effort.
Swansea hit back with a stinging shot from Joe Allen which Allen turned aside for a corner.
The East Midlanders levelled on 39 minutes when Matt Fryatt held up the ball before feeding Wales international King, who expertly drilled home from 18 yards.
Paul Gallagher came on for Lloyd Dyer in the 57th minute and almost scored with his first touch when he flashed a shot just wide.
De Vries was Swansea's saviour again 68 minutes when he tipped over a shot from Fryatt after good work by Richie Wellens.
Wellens then had the chance to win it for the home side five minutes from the end when he side-stepped two defenders to give himself a clear view of goal but failed to deliver after shooting tamely at the keeper.
But the Foxes clinched it on 88 minutes when Ryan McGivern's free-kick was nodded back across goal by Yann Kermorgant for N'Guessan to score with a superb header from six yards.