You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
Forward Sergio Aguero also scored two in the first half at the City of Manchester Stadium, but England winger Sterling was the star of the show as the home side made it three wins from three to open up a five-point lead half way through the group stage of the competition.
Atalanta have now lost all three of their matches in their debut season in the Champions League, but started brightly and had the lead via a Ruslan Malinovsky penalty.
City were ruthless in their response though and drove forward but they finished the game with 10 men after teenager Phil Foden received a second yellow card on 83 minutes.
"It was a really good result. The way Atalanta played created that," City manager Pep Guardiola told BT Sport. "It was man to man all over the stadium, it was not comfortable, we're not used to playing against these teams.
"It was no surprise Atalanta finished third last season in Italy and even this season, they're playing well, so it's an incredible result. It's three more points. One more win and we'll be in the next stage."
Atalanta showed admirable ambition in the opening stages and were rewarded on 28 minutes. Malinovsky converted the penalty after Fernandinho had brought down Josip Ilicic just inside the box.
If City were rattled by going behind, they did not show it and instead lifted the tempo of their play.
They were level six minutes later when Sterling's magnificent cross was turned into the net from close-range by Aguero for his 60th goal in 100 European appearances.
Sterling won a penalty when his surging run was illegally stopped by defender Andrea Masiello for the second clear spot-kick of the night.
Aguero drilled the ball low into the left-hand corner for the lead, but the half ended on a sour note when City’s makeshift centre-back Rodri limped off with a hamstring problem to be replaced by John Stones.
Sterling got the goal his performance richly deserved on 58 minutes as Kevin De Bruyne picked out Foden in the box and the latter's lay-off was easy for the winger to finish.
Five minutes later and he had another. Played into space on the left, he turned inside the covering defender and provided an emphatic finish, before his hat-trick was complete when he poked home a Riyad Mahrez cross from close-range.
Sterling should have had a fourth too when Foden’s excellent pass sent him clear on goal, but he put the ball the wrong side of the post.
"Raheem was brilliant. He could have scored one more. Not just with the ball, without the ball, he helps us a lot," Guardiola said.