City were pushed by Everton in the first half, with Richarlison cancelling out Phil Foden’s opener as Pep Guardiola’s side conceded a league goal from open play for the first time in 45 days.
But once Mahrez put them back in front with a sweet left-footed strike just after the hour there was no looking back.
With the Merseyside derby to come at Anfield on Saturday, this is a crucial phase in the season.
“It was a really difficult game,” Ancelotti said. “For one hour we had good control – defending of course, we needed to defend but for one hour we did well.
“But when they scored the second it was almost impossible to come back again. We don’t need to have regret for this game. In this moment you can lose against Manchester City.
“I think they are going the right way to win the title this season.”
James Rodriguez came on as a second-half substitute but Allan was not involved, held back as a precaution, while a first-half injury for Yerry Mina looks like ruling the Colombian out of facing Liverpool.
“Mina had a problem on his calf and I think he will not be available for the game on Saturday,” Ancelotti said.
“But we hope to have (Dominic) Calvert-Lewin and Allan also.”