Juventus lost 1-0 at home to Udinese in their opening game of the season last weekend and the champions looked rocky at the back from the off as Seydou Keita and Iago Falque fired wide inside the first 10 minutes.
© Getty Images
Roma continued to dominate the early stages and had yet another early opportunity when Mohamed Salah drove forward from his own half and played in Alessandro Florenzi, who perhaps should have squared the ball instead of hitting a tame shot wide of Gianluigi Buffon's goal.
As Juve struggled to retain any kind of possession, the home side came within inches of taking a deserved lead when Pjanic was unlucky to see his superb strike from the edge of the box cannon against the post with Buffon beaten.
The visitors had their first chance of the match shortly the restart when Roma failed to clear a corner effectively and Martin Caceres lashed high over the bar, before Roma finally had the lead they deserved when the impressive Pjanic curled home a stunning free kick past the motionless Buffon.
© Getty Images
Paul Pogba headed wide from a good position after a rare Juve attack before Massimiliano Allegri's side's task got harder when Patrice Evra was sent off for a second yellow card in the space of four minutes.
Roma made their numerical advantage count immediately as Dzeko powerfully headed home his first goal for the club with 11 minutes remaining to double the lead.
Juve were denied an undeserved point when Szczesny saved brilliantly from Giorgio Chiellini's injury-time header, but Roma held on to make it two defeats from two games for last season's champions.