Leandro Castan put Roma in front in the seventh minute, but Facundo Roncaglia levelled seven minutes later.
Totti put Roma back in front before extending their lead before half-time and setting up a fourth for Pablo Osvaldo in the 89th minute.
In between, Mounir El Hamdaoui gave Fiorentina hope in a game full of chances at both ends.
The first goal arrived after just seven minutes with Panagiotis Tachtsidis heading Totti's cross goalwards and Castan was on the line to get the final touch with his head.
Fiorentina levelled just seven minutes later when Borja Valero's long ball forward sent Rodriguez through as the Roma defence stepped up trying to catch him offside.
Instead, they left him with a free run on goal, yet he chose to square the ball to Roncaglia who swept it in past Mauro Goicoechea.
Only four more minutes passed before Totti gave Roma the lead once again.
Mattia Destro got to the goal line and pulled the ball back to Totti, who teed himself up with his first touch before firing past Emiliano Viviano with his second.
The chances continued to flow at both ends with Roncaglia stinging the palms of Goicoechea with a shot from distance in the 34th minute before Viviano pushed Miralem Pjanic's shot wide at the other end.
Just before half time, Destro was denied by the Fiorentina goalkeeper from Pjanic's pull-back in a very open game.
Totti then extended Roma's lead with the last kick of the first half, a curling effort from fully 30 yards which had enough power to cause Viviano problems, but should probably have been kept out by the Viola custodian, who just flapped at the ball on its way in.
Fiorentina pulled a goal back immediately in the second half with substitute El Hamdaoui's first touch.
Valero's deep cross was headed past Goicoechea, who was moving in the other direction and was unable to get back across to keep the ball out.
Viviano made a good save to deny Tachtsidis less than a minute later as Roma almost replied immediately, and he then denied Michael Bradley with Destro's follow-up blocked by a defender.
Fiorentina kept plugging away and substitute Haris Seferovic's shot was pushed wide by Goicoechea with Bradley making a clearance off the goal line to keep out Alberto Aquilani's header from the corner.
Osvaldo then had the last say in an entertaining game with Roma's fourth, threaded through Viviano's legs after Totti nutmegged a defender to set him up.