Totti struck an unstoppable winner in the 58th minute as Roma edged up to within six points of the top five while Juve's five-point advantage at the top of Serie A could be cut by Napoli on Sunday.
Lazio will also take joy in Roma's win as it can get back into the hunt with a victory at Siena on Monday night.
There were plenty of smiles and hugs as captains Totti and Buffon exchanged pennants before the coin toss, but as has been the case nine times in the past already, Totti ultimately wiped the smile off Buffon's face.
His goal in the 58th minute was worthy of winning any match, and it left Buffon with no chance.
Miralem Pjanic's direct free kick attempt was blocked by a Juve defender and the ball fell to Totti 25 yards from goal.
He did not think twice as he made perfect contact with the ball, rendering Buffon's dive unnecessary as the net was already rippling before the Italy number one even got near it.
Totti's strike was no more than the Giallorossi deserved after dominating the first hour against the champions.
Pablo Osvaldo had already wasted a hat trick of chances, the best of which a header straight at Buffon in the 57th minute, while the closest Juve had come was early in the second half when former Roma striker Mirko Vucinic volleyed wide.
Andrea Pirlo, who suffered an early scare after a clash of knees with a concerned Totti, had also brought a fine save out of Maarten Stekelenburg with a curling free kick, but Juve was lacking its usual bite.
Roma, on the other hand, continued to cause the Juve defence concern with Erik Lamela dancing his way through, but overdoing it a little in the 70th minute as his last stepover let him down.
Nicolas Anelka was sent on by Juve coach Antonio Conte to add further weight to his attack but although he set up fellow substitute Sebastian Giovinco for a chance late on, he could not alter the course of the game as Roma picked up a morale-boosting victory at the Stadio Olimpico.
In Saturday's other game in the Italian top flight, Palermo moved off the foot of the table thanks to a 1-1 draw at Chievo in a game of two contrasting halves at the Stadio Marc'Antonio Bentegodi.
The Rosaneri took the lead in the fifth minute through Mauro Formica and it was a one-sided opening 45 minutes in which Palermo failed only to add a second goal.
Chievo responded well in the second half, though, and equalized through Cyril Thereau's penalty.
Information from Press Association was used in this report.