Ronaldinho spot on as Milan qualify
The Italians went through to the first knockout round thanks to Real Madrid's 3-1 win at Olympique Marseille in the other Group C game.
Zurich, already eliminated but winners away to Milan earlier in the group stage, took a shock lead with Milan Gajic's free kick after 29 minutes.
Ronaldinho then sent Johnny Leoni the wrong way in the 65th minute after Marco Boriello had been fouled by Alain Rochat, who was shown the red card.
Milan finished with nine points from their six games and Zurich four. Real Madrid topped the group with 13 points while Marseille finished third with seven and will play in the Europa League last 32.
Zurich coach Bernard Challandes said his team had salvaged some pride after 5-2 and 6-1 defeats to Real Madrid and Olympique Marseille respectively.
"We dreamed of the Champions League, we lived it and we wanted to finish well," he said. "We can be satisfied with the result."
AC Milan coach Leonardo was relieved: "We weren't brilliant today but it was very important to qualify.
"There were a lot of factors at play, things were a bit complicated, we had a lot of players with physical problems and it wasn't easy to prepare."
The result was a huge letoff for the Serie A team who had barely mustered a chance before the penalty but took control of the game afterwards.
Although Milan had the first chance when Alexandre Pato's shot was saved by Leoni's foot, Zurich then took command.
Adrian Nikci went close from 20 metres before Alexandre Alphonse wasted an even better chance when he fired over after being given a clear run on goal.
It was no surprise when Gajic gave the group-stage debutants the lead when he eluded the wall with a free kick from the edge of the penalty area.
With Ronaldinho, Pato and Boriello all ineffective, Milan made little headway until the penalty changed the complexion of the game.