The Premier League leaders were made to sweat before eventually prevailing 6-3 in an enthralling encounter which manager Pep Guardiola described as a “rollercoaster”.
City had raced into a 4-0 lead inside 25 minutes only to be pegged back to 4-3 before late goals from Aymeric Laporte and Sterling – his second of the game – finally secured the points.
After wins over struggling Leeds and Newcastle by an aggregate score of 11-0 in the previous two games, Sterling felt this was a wake-up call for the champions.
“It was a game we needed to finish off,” said the England forward, who has now scored eight goals in his last 10 appearances in all competitions.
“It was a good (first) 45 (minutes) but these are games we have got to put to bed. That is the challenge.
“We have got to keep that concentration and in the first 20 minutes of the second half we didn’t have that.
“We are disappointed to concede those goals but we kept the focus, kept trying to play and got the result we needed in the end.”
City’s victory was their ninth in succession and, with second-placed Liverpool not in action, it took them six points clear at the top of the table halfway through their campaign.
“It has been a decent start so far,” Sterling added. “We need to keep the focus and go into the new year with the same mentality. We need to keep going and that is all we can do.”
Leicester felt the full force of City’s attacking power early on as Kevin De Bruyne opened the scoring inside five minutes and Riyad Mahrez added a second from the penalty spot after Youri Tielemans fouled Laporte.
Ilkay Gundogan tapped in a third and Sterling fired home City’s second penalty after he himself was brought down; Tielemans again having been the guilty party.
But for Kasper Schmeichel it might have been more but the Foxes rallied after the break with the inspirational James Maddison pulling one back. Ademola Lookman grabbed another and Kelechi Iheanacho further reduced the deficit but City ultimately had too much.
“They countered us and we got punished,” said Sterling. “Every time they attacked, they created chances.
“But we are happy we got the win in the end and we want to keep that going. It is nine games (in a row) in the Premier League now.”
Register for free to continue reading
Registration is a free and easy way to support our truly independent journalism
By registering, you will also enjoy limited access to Premium articles, exclusive newsletters, commenting, and virtual events with our leading journalists
Already have an account? sign in
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies