The win left Roma sixth on 62 points, behind AC Milan on their head-to-head record, with two games left.
Needing a top four finish to qualify for the Champions League, they are three points behind third-placed Atalanta and one adrift of Inter Milan, who have a game in hand.
Roma remain two points clear of Torino who twice came from behind to beat Sassuolo 3-2 earlier on Sunday.
Juventus, who wrapped up the title with five games to spare, wore their new strip despite many fans objecting to the decision on social media.
The new design, confirmed by the club shortly before kickoff as their new home shirt for next season, also features a pink pinstripe between the two halves. “Change is not to be feared,” said the club on Twitter.
Roma goalkeeper Antonio Mirante made brilliant early saves to deny Juan Cuadrado and Paulo Dybala before Lorenzo Pellegrini hit the bar for the home side. Juve also hit the woodwork when Mirante somehow turned Dybala’s drive onto the post before halftime.
Cristiano Ronaldo thought he had put Juventus ahead when he collected Dybala’s pass before running on to slot the ball past Mirante but he was fractionally offside.
Instead, Juventus defender Giorgio Chiellini lost possession in his own half and Florenzi finished off a quick exchange of passes by gently chipping the ball over Wojciech Szczesny in the 79th minute.
Dzeko then finished off a counter-attack in stoppage time to hand Juve their third league defeat of the season.
AS Roma kept their Champions League hopes alive on Sunday when late goals from Alessandro Florenzi and Edin Dzeko gave them a 2-0 home win over Serie A champions Juventus.
The match also saw the Turin side’s controversial black-and-white halved shirts made an inauspicious debut, replacing their traditional stripes after 116 years.