Feyenoord were on course to keep out the free-scoring Premier League leaders until Sterling finished off a typically slick move just two minutes from time.
The England winger picked up the ball before playing a smart one-two with Bernardo Silva then clipped a lovely finish past former Liverpool keeper Brad Jones.
Before that Guardiola hadn't been a happy man as he saw his much-changed side struggle.
The City boss prowled his technical area in frustration as the home side struggled to get the win.
Brilliant With qualification already in the bag and against a side who have had four straight defeats, some might have expected a cakewalk – seven changes or not.
This was proving far from easy and Guardiola looked a bit brassed off as he made his way down the tunnel at half-time – and it wasn't hard to see why.
And had it not been for a brilliant 69th minute save from Ederson, they would have found themselves behind.
The keeper somehow managed to push a shot from Steven Burghuis over the top to keep thing level.
This was far from Guardiola's first choice line-up but that shouldn't have hindered his star-studded side quite as much as it did.
They were the dominant side but it was all a bit stodgy. And they got themselves into a flap at the back when Ederson twice found himself in compromising positions which could quite easily have led to goals or penalties.
City's perfect start of four wins from four had guaranteed their passage to the knockout stages but there was still a job to be done here.
Sergio Aguero, back in the line-up after his rest following dizzy spells, tried his best to break the deadlock.
He went closest with a 33rd minute header from Kevin De Bruyne's cross which flashed just past the angle and he also tested Feyenoord keeper Jones with a shot from the edge of the box which lacked power and direction.
City's frustration began to show with Yaya Toure and De Bruyne both getting booked within the space of a few minutes for fouls – the Belgian's yellow card conveniently ensuring he will miss the final dead-rubber group game away to Shakhtar Donetsk.
MANCHESTER CITY (4-3-3): Ederson; Walker, Otamendi, Mangala, Danilo; Gundogan, Toure, De Bruyne; B Silva, Aguero, Sterling. Subs: Bravo, Delph, D Silva, Fernandinho, Jesus, Foden, Diaz.
FEYENOORD (4-3-3): Jones; Diks, Tapia, Van Beek, Haps; Amrabat, Toornstra, Vilhena; Berghuis, Boetius, Larsson. Subs: Vermeer, Nieuwkoop, St Juste, Jorgensen, Basacikoglu, Nelom, Kramer.
Referee: Ivan Kruzliak (Slovakia)