Both sides finished on 15 points have already qualified for the knockout stages.
beating City 3-1
in Manchester in the first group game, holders Bayern went through as group winners ahead of City because of their better head-to-head goals record.
With the score at 3-2, Pellegrini opted to bring on midfielder Jack Rodwell for striker Edin Dzeko, rather than introduce Argentina international Aguero, the club's top scorer this season with 18 goals.
"I said it would be very difficult to beat Bayern by three goals," said Pellegrini, who gave the impression he had given up on the 5-2 scoreline he seemed to think they needed.
The 3-2 win
looked unlikely after the hosts struck twice in the first 12 minutes through Thomas Muller and Mario Gotze.
But goals from David Silva, Aleksandar Kolarov and James Milner inflicted just a third defeat of 2013 on Bayern, who are 40 matches unbeaten in the Bundesliga.
Milner's goal came after 62 minutes, before Pellegrini replaced midfielder Silva with striker Alvaro Negredo 11 minutes later.
Pellegrini added: "It was very important to score another goal. Alvaro Negredo had the chance for a fourth goal and if that happened I would have made another change."
The victory was Pellegrini's first over Bayern boss Pep Guardiola after defeats by the former Barcelona coach while in charge of Villarreal, Real Madrid and Malaga.
And he hopes it will help improve his team's domestic away form, having won only twice in the Premier League on their travels this season.
The City boss added: "We wanted revenge for the first game and it was not that different between Bayern and our team. To win here and score three goals without Vincent Kompany, Yaya Toure and Sergio Aguero shows we have a very good squad also, so it's a very important victory.
"I know that we didn't have results in Premier League playing away but we haven't played badly in those games, so we must continue finding a style of play - and this match could be very important for us."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.