Juve, third going into the midweek matches, stayed unbeaten after eight league games of the season and went back to the top of the table, at least until Wednesday.
Juventus have 16 points from eight games, one ahead of Udinese, who visit Napoli on Wednesday, and two more than Lazio who are at home to Catania.
Fiorentina slipped to 14th with nine points.
Leonardo Bonucci gave Juventus the lead but Stevan Jovetic levelled just before the hour as the hosts, who twice squandered the lead in a 2-2 draw with Genoa on Saturday, threatened to throw away another win.
Antonio Conte's team went ahead in the 13th minute when Artur Boruc failed to hold Antonio Vidal's shot and Bonucci tapped in the rebound.
Fiorentina barely had a look-in during the first half but were a different proposition after the break and equalised in the 57th minute.
Alberto Gilardino found Juan Vargas and he back-heeled the ball to Montenegro forward Jovetic, who curled it into the top corner from the edge of the area for his fifth goal of the season.
Juventus looked shaky but struck back with 20 minutes left, Simone Pepe threading the ball through a pack of defenders for Matri to place his shot beyond Boruc.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.