Roma had Daniele De Rossi and Leandro Castan sent off to end their 17-game unbeaten run.
Carlos Tevez fired Juventus into the lead in the sixth minute but Maxi Moralez's strike saw Gianluigi Buffon's unbeaten streak end at 744 minutes.
The sides' final Group B clash at the Ali Sami Yen Stadium was stopped in the 31st minute with the scoreline 0-0, as increasingly heavy snowfall made playing conditions nearly impossible.
Arturo Vidal and Giorgio Chiellini netted a goal each as Juventus beat Bologna 2-0.
Pirlo left the pitch for treatment after suffering a knock to his knee during a 1-0 win over Udinese.
Antonio Conte's side ideally required a win against the Danes to relaunch what has been an uninspiring campaign, and after being frustrated on their way to a 1-1 draw in Copenhagen the Italian champions did not disappoint.
Juventus, with whom goalkeeper Gianluigi Buffon made his 500th Serie A appearance, now have a two-point cushion on overnight leaders Roma ahead of the capital side's home game against struggling Cagliari on Monday.
Fernando Llorente, Andrea Pirlo and Paul Pogba sent Juve to within one point of table-toppers Roma
Bayern made heavy weather of beating Viktoria Pilsen 1-0 while City reached the knockout stages for the first time, after flopping in the group stage the last two seasons, with a 5-2 thumping of CSKA Moscow in Manchester.
Despite Juventus holding a 2-0 lead at half-time following a Carlos Tevez penalty and a strike from Paul Pogba, the champions crumbled during 14 second-half minutes in which 'La Viola' staged a remarkable comeback.
The 20-year-old Frenchman, who joined Juventus from Manchester United in a free transfer in the summer of 2012, is tied to the club until June 2016. Juventus are ready to offer him a new contract with improved terms as he has made impressive progress after he came to Italy.
Mexes aimed a punch at Juventus' Giorgio Chiellini which was was captured by TV.
With Roma comfortably on top with 21 points from seven games, Napoli and Juventus are both two points adrift in second and third respectively with Inter in fourth.
Manchester United was held to a 1-1 draw at Shakhtar Donetsk, while City's former coach Roberto Mancini steered Galatasaray to a 2-2 draw at Juventus, just two days after taking charge of the Turkish side.
Juventus's fifth win in six games leaves them level on 16 points with leaders Napoli but second due to inferior goals difference.
Antonio Conte made a number of changes from his usual starting 11 for the clash against the Danish title-holders, who have endured a mediocre start to their domestic season.
Earlier, Marek Hamsik scored his second brace in as many Serie A games and Gonzalo Higuain netted his first goal for Napoli as Rafael Benitez's side won 4-2 at Chievo.
Kaka has never really settled in Madrid and remains unhappy despite his former Milan coach Carlo Ancelotti now being in charge at the Santiago Bernabeu.