Napoli, who had coach Walter Mazzarri sent off at the end, nearly undid Cavani's work by gifting Atlanta two goals with defensive howlers but stayed second in Serie A after Goran Pandev scored the winner four minutes from time.
Balotelli gave third-placed AC Milan a 2-0 win over joint bottom club Palermo, who have fired three coaches in their last six games and had Giuseppe Sannino starting his second stint of the season in the hot seat.
Serie A's leading scorer Cavani, who had not scored in his last eight games, took his league tally to 20, while Balotelli has netted seven times in six appearances since his move from Manchester City.
Totti inspired Roma to a 2-0 win over Parma with a repertoire of skills including a stunning backheel pass, a free-kick smashed against the crossbar from an improbable angle and his team's second goal. Erik Lamela had put Roma ahead after seven minutes.
Roma went level on points in sixth place with neighbours Lazio who lost 1-0 at Torino in driving snow after defender Michel Ciani was sent off in the 16th minute after receiving two yellow cards within 43 seconds. Jonathas scored a late winner for the hosts.
Pescara stayed level at the bottom with Palermo after conceding two goals in the last five minutes and losing 2-0 at home to Chievo while Siena missed a chance to move out of the relegation zone when they were held 0-0 at home by Cagliari.
Fourth-placed Fiorentina emulated Napoli as they twice surrendered the lead at home to Genoa before a Mattia Cassani own goal gave them a 3-2 win.
They were helped by a blunder from Genoa goalkeeper Alexandros Tzorvas who fumbled a cross in the run up to Fiorentina's second, allowing Juan Cuadrado to tap in.
Napoli, who have 56 points, stayed nine behind leaders Juventus, 2-0 winners at Bologna on Saturday, and two ahead of Milan, who are in the Champions League qualifying round spot.
Fiorentina are a further three points behind while fifth-placed Inter Milan's match at Sampdoria was postponed due to heavy rain.
Cavani quickly ended his barren run in the fourth minute when Juan Camilo Zuniga was fouled just inside the area and the Uruguayan, who missed a penalty last week at Chievo, stepped up and converted, although Andrea Consigli got a hand to it.
Napoli wasted a flurry of chances and conceded a bizarre equaliser. Giacomo Bonaventura broke got away on the right, German Denis miscued with the goal at his mercy but the ball hit Paolo Cannavaro on the head and rebounded into the goal.
Carlos Carmona rattled the Napoli crossbar with a free-kick but the hosts regained control and Cavani struck again with a superb effort in the 65th minute.
Receiving a short pass by Pandev, he wrong-footed three defenders with his first touch and rolled the ball into the far corner.
Atalanta replied eight minutes later when a long ball
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.