You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
A game that could easily have ended in frustration, with Dinamo defending deep and effectively, turned on the introduction of England international Sterling in the 56th minute.
The Croatians frustrated the Premier League champions with some excellent defending in the first half and all City could manage from their domination was Ilkay Gundogan's shot against the bar in the 21st minute after an earlier effort from Sergio Aguero had been well dealt with by Dinamo keeper Dominik Livakovic.
David Silva screwed a shot wide after the ball fell to him inside the area but City did not create enough from the amount of possession they enjoyed.
Guardiola's side attacked almost exclusively down the left, where fullback Benjamin Mendy was allowed plenty of space, but either the delivery into the box let them down or the Dinamo defence stood firm.
Riyad Mahrez on the right flank saw too little of the ball and City failed to really use the full width of the field, too often getting involved in 'five-a-side' contests on the edge of the box.
The introduction of Sterling increased the tempo and width of City's play and it was the England international who broke the deadlock in the 66th minute, turning in a low cross from Riyad Mahrez after a superb diagonal pass from Rodri.
Dinamo tried their luck in the final stages but were caught on the counter in stoppage time with Sterling breaking and slipping the ball wide to Foden who confidently drove home.
City move on to six points from their opening two games after winning their first match 3-0 at Shakhtar Donetsk, while Dinamo have three points.
"They defended so well, even the goal from Raheem the defender was there. I didn’t expect them to play so deep, they only shot on target at set pieces, but they did what they did so well," said Guardiola, who praised Sterling for his improved finishing.
“He’s a player who is always there, he has this talent he loves to score goals, you always have that feeling. We had chances but they defended really well and that’s why it was difficult to score a goal," he said.
"I think still he can improve his finishing. Today the pass for Phil was perfect. But still there is a gap to be even more clinical but it’s important that all the time he’s there and that’s why he’s been able to score the goals," he said.
Foden's instant impact, with his goal coming four minutes after he came on, left Guardiola feeling sorry that he was unable to find more minutes for the talented 19-year-old.
“I know, he deserves to play, I want to give him minutes, I’m unfair to him, I’m sorry but he has (Kevin) De Bruyne, Bernardo Silva, Rodri (ahead of him).
"I know the best way is for him to play minutes but he’s so young. I don’t know many players of his age (who) have played so many minutes, he’s going to be incredible in the future but it is what it is."