City, beaten 3-2 by Crystal Palace last time out, were in front after 14 minutes when Bernardo Silva finished with his left foot after being played through by Sergio Aguero.
But four minutes later Leicester were back on level terms after Marc Albrighton met Jamie Vardy's cross with his head from close range.
Leicester's defence held tight despite an onslaught from City, with Fabian Delph and Aguero both missing good chances.
Pep Guardiola's team were made to pay for those spurned opportunities as Ricardo unleashed an unstoppable shot into the top left corner beyond Ederson less than 10 minutes from time.
Things went from bad to worse for City as Delph was shown a straight red for following through in a challenge on Ricardo, capping a miserable afternoon for Pep Guardiola's team who slipped to third in the table.
"It was a similar performance to the Crystal Palace game, we started well but conceded a goal the first time they arrived in our box. Mentally we are lacking confidence in that situation," Guardiola told the BBC.
"We have to accept it, we have to realise that we have to work harder and try to get immediately one good result and get our confidence back.
"Of course, we are worried (about not keeping clean sheets), the result is what counts, we lost."
Leicester manager Claude Puel was facing questions about his future at the club before Saturday's win over Chelsea.
"A good Boxing Day! We know when you play Chelsea and City it's difficult to have the ball but you must have this mentality to defend together and try to use good recovery and fast passes to break," he said.
"We deserved this result. We had more chances than them. We changed the system to get a better balance in the team and it is a fantastic result for this team."
KINDLY DROP A COMMENT BELOW