Dinamo needed to win to have any chance of joining City in the last 16 and got off to the perfect start through Dani Olmo's sweetly struck volley 10 minutes in.
However, even a much-changed City side had way too much quality for the hosts as the game wore on and a trio of fine finishes from Jesus in a 20-minute spell either side of half-time secured a morale-boosting win.
Three things we learned from the Premier League
Phil Foden rounded off the scoring as defeat saw Zagreb slip to the bottom of Group C and out of European competition for the season.
Pep Guardiola made eight changes from the side beaten 2-1 at home by Manchester United on Saturday to leave the English champions 14 points off the top of the Premier League table with Raheem Sterling and Kevin De Bruyne among those left on the bench.
Derby defeat meant City had won just two of their previous seven games in all competitions and another poor night beckoned when Damian Kadzior's cross was brilliantly smashed past Claudio Bravo by Olmo, despite the Chilean goalkeeper getting a hand to it.
City have now kept just one clean sheet in 12 games, but instead of exploiting the weaknesses in the visitors' defence, Zagreb sat on their lead and were punished as Guardiola's men took control of the game.
Dominik Livakovic parried a warning shot from Ilkay Gundogan before City's pressure told with an equaliser 11 minutes ahead of half-time.
Dinamo were unhappy play was not stopped as they had a man down injured, but City were within their rights to play on and Jesus rose highest to head home Riyad Mahrez's cross.
Benjamin Mendy has struggled for fitness and form on his return from nearly two full seasons out injured, but the French left-back's performance was among the most encouraging of the night for Guardiola.
Red-hot Vardy fires title-chasing Leicester to club record win
Mendy made his name rampaging forward for the Monaco side that reached the semi-finals of the Champions League three seasons ago and looked more like his old self as he was involved in both Jesus's goals inside the first 10 minutes of the second half.
Firstly, neat interplay from Mendy and Foden freed the Brazilian inside the area and he turned onto his strong right foot before finding the far corner.
Foden was also involved for the third as his pass fed Mendy, whose teasing cross left Jesus with the simple task of prodding into an empty net.
Jesus is making the most of his extended run in the team in the absence of the injured Sergio Aguero and his importance ahead of a busy festive period in the Premier League was underlined as he was replaced moments after completing his hat-trick.
City still added a fourth as Foden made his case for more playing time by slotting home Bernardo Silva's cross six minutes from time.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ