Paris Saint-Germain and Real Madrid missed early opportunities to qualify by being held to draws - and both had to come from behind. PSG was held 1-1 at home by Anderlecht and Real settled for a 2-2 draw at Juventus.
In a match with few thrills, substitute Mario Mandzukic scored with a second-half header to put Bayern through, while a hat trick from Alvaro Negredo and a brace from Sergio Aguero propelled City into the next stage.
Bayern captain Philipp Lahm said his team had "slept through the early stage of the match. Perhaps we think it's going to be easy."
Bayern has four wins from four games and tops Group D with 12 points, while second-place City has nine following its victory over CSKA.
"It shows how strong a team we have," Guardiola said, adding his team's performance will get even better. "We have a new coach, new players. We need time before we stabilise our game."
It was Bayern's ninth consecutive win in the Champions League over two seasons, equaling Barcelona's record from the 2002-03 campaign. Bayern and City advanced with two matches to spare.
"Every coach would have to be happy about that and I'm not an exception," Guardiola said through a translator. "I hope it is a boost for us and we will be able to improve that record at CSKA Moscow."
Aguero, who has scored in six straight games, converted a penalty in the third minute, added a second in the 20th and then fed Negredo as City raced into a 3-0 lead after half an hour in Manchester.
"Aguero is in a great moment, not only because he's scoring but because the whole team is playing offensive football and that's important," City's coach Manuel Pellegrini said.
CSKA striker Seydou Doumbia also scored twice - either side of Negredo's second goal in the 51st - before the Spain striker completed his hat trick with the last touch of the game from a header.
"The minimum target was to qualify for the next round but it's not the only target," City's coach Manuel Pellegrini said. "I'm sure the team we play (in the last 16) will not be very happy to play against us."
Group A leader Manchester United and second-place Bayer Leverkusen were both held to 0-0 draws away from home, at Real Sociedad and Shakhtar Donetsk, respectively.
Robin van Persie, who substituted Wayne Rooney, hit the post with a powerful penalty shortly after driving against the same piece of the woodwork. United's Marouane Fellaini was sent off late in the game as Real Sociedad won its first point.
"That was a game we should have won. It was there for us to take the points, get ourselves in a really strong position, and near enough get clear," United manager David Moyes said. "At the moment we're still top of the group and in a good position."
Leverkusen came home with a point from Shakhtar Donetsk, which remained third in the group. United has eight points, Leverkusen seven, Shakhtar five and Sociedad one.
Juventus and nine-time champion Real Madrid provided an entertaining 2-2 draw, leaving the Spanish side on the verge of qualifying for the knockout stages.
"I don't think we've yet reached our best, we're still improving. Juventus is a solid and strong squad with good talent, I think in the end they will pass the round with us," Real's coach Carlo Ancelotti said.
Juventus dominated the first half and Arturo Vidal gave the Italian side a halftime lead from the penalty spot before Cristiano Ronaldo leveled for Madrid with his 21st goal in 16 matches this season and turned provider minutes later as Gareth Bale put Carlo Ancelotti's side in front.
Ronaldo leads the competition with eight goals, equaling the group-stage record shared by Ruud van Nistelrooy, Filippo Inzaghi and Hernan Crespo.
Madrid's lead lasted just five minutes before Fernando Llorente headed Juventus level.
Madrid dropped its first points but remains top of Group B with 10 points, while Juventus slipped to bottom spot after Copenhagen beat Galatasaray 1-0 with an early goal by Daniel Braaten.
"We need to beat Copenhagen at home and then play for everything against Galatasaray," Juventus coach Antonio Conte said. "We should be fortified because we had a great performance and a good result against a really strong team. My players showed on the pitch that we can play against anyone."
Galatasaray and Copenhagen have four points, and Juventus three.
PSG crushed Anderlecht 5-0 two weeks ago, but this time needed an equalizer from Zlatan Ibrahimovic after the visitors took the lead against the run of play midway through the second half.
Despite playing the last 10 minutes with an extra man after Anderlecht midfielder Sacha Kljestan was sent off, PSG failed to break down a resilient Belgian side.
"Before talking about victory and how many goals you're going to score, you have to win the match," PSG coach Laurent Blanc said. "We were too average, including in front of goal because we missed six or seven chances. It's a good wake up call."
Midfielder Demy de Zeeuw gave Anderlecht the lead - with his team's first goal of the campaign - in the 68th minute after a quick counterattack, but Ibrahimovic leveled just two minutes later.
PSG leads with 10 points in Group C and second-place Olympiakos has seven after beating Benfica 1-0, courtesy of an early goal by Kostas Manolas. Benfica has four points and Anderlecht one.
Benfica missed a dozen chances and coach Jorge Jesus kept throwing up his arms in disbelief every time Olympiakos goalkeeper Roberto denied his team.