The hosts trailed 2-1 at halftime but former Liverpool winger Sterling struck in the 80th and 81st minutes while substitute Wilfried Bony was also on target late on as City rallied to finish top of Group D with 12 points.
By pipping Juventus for first place, they will avoid the big-hitting trio of Barcelona, Bayern Munich and Real Madrid in the draw for the last 16.
“I told him (Sterling) before the game that the minimum he had to do today was score two goals,” manager Pellegrini told the already-qualified Manchester club's website (www.mcfc.com).
“I'm not joking, I told him that. I think it was important for him to score those goals tonight.”
With City missing the injured Sergio Aguero and Bony demoted to the bench, Pellegrini opted to use 21-year-old Sterling as a makeshift central striker against Gladbach and the decision yielded handsome dividends.
“If we play the way we did in the second half we can play against any team,” said Pellegrini.
“Once we were losing 2-1 we didn't concede one chance. They (Gladbach) haven't lost since they lost to us (in September) and they beat Bayern Munich (at the weekend) so it wasn't easy.
“Last year we played very well against Bayern and Roma but this is one of the best nights we've had in Europe,” added Pellegrini.
It is the first time big-spending City have finished top of a Champions League group.
They were runners-up in their groups in 2013-14 and 2014-15 and both times were knocked out by Barcelona in the last 16. – Reuters
Original source: Raheem delivers sterling performance