City, who had already secured the group's top spot, finished with 14 points from six games, seven ahead of Atalanta who joined them in the last 16 after a 3-0 win at Shakhtar Donetsk.
Third-placed Shakhtar, who collected six points, will carry on in the Europa League's last 32 while Dinamo (five points) were eliminated from European competition.
City manager Pep Guardiola, who fielded a strong side despite the match being a dead rubber for the English champions, was pleased after they amassed 501 goals in 199 games under his tenure in all competitions.
"In the first half we struggled a bit, but we played 75 minutes very, very well overall, so a good result," he told BT Sport.
"We'd qualified but we came here for the club, for the prestige, to learn to play in this competition."
Jesus added: "It’s special, when I’m young I think about playing and scoring in the Champions League so it’s very special to score goals and a hat-trick as well."
Aiming to reach the Champions League knockout stages for the first time, Dinamo made a bright start as Spanish forward Dani Olmo fired them into a 10th-minute lead with a sumptuous volley.
Jesus levelled in the 34th after Ilkay Gundogan had gone close amid some sustained pressure from City, rising above two markers to head home a Riyad Mahrez cross from the left.
The Brazilian then produced a jinking run after a one-two with Phil Foden in the 50th minute, weaving his way past several defenders on the left before beating home keeper Dominik Livakovic with a neat finish.
The irrepressible Jesus completed his one-man show four minutes later with a clinical side-footed shot from close range after left-back Benjamin Mendy delivered an inch-perfect cross from the left.
City took their foot off the pedal after Jesus was substituted in the 65th minute but Foden added some gloss to the scoreline in the closing stages as he swept in a fine pass by Bernardo Silva.
Dinamo boss Nenad Bjelica was pleased with his team's effort throughout the group stage.
"I've got a top bunch of lads here and I am proud to be in charge of them," he told a news conference.
"We've restored the fans' faith in Dinamo and they've flocked back to the terraces this season. We played well in the first half against City but their quickfire goals sent us reeling and we were unable to recover."