Totti put the Giallorossi in front with Mattia Destro adding a second, with De Sanctis making fine stops after each goal.
Giampiero Pinzi did finally pull a goal back for Udinese early in the second half, but Vasilis Torosidis restored Roma's two-goal lead midway through the second half.
De Sanctis made another excellent save before Dusan Basta set up a grandstand finish, but Roma held on move three points clear of third-placed Napoli and remain on course for a place in the Champions League next season.
Totti made his return to the Roma side after over a month out, and it took him just 22 minutes to get his name on the scoresheet.
Miralem Pjanic squared for Gervinho, whose shot was saved by Simone Scuffet, but the ball fell out for the Roma captain, who swept it into the bottom left-hand corner from close to the penalty spot.
A minute later, De Sanctis made a fine one-handed save low down to his left to keep Emmanuel Badu's shot out as Udinese threatened an immediate riposte.
But instead, it was Roma who extended their lead on the half-hour mark.
Gervinho threaded a ball through perfectly, for Destro, who took it round Scuffet and slid it into the unguarded goal.
Like after the first goal, Udinese nearly replied immediately, but for another stunning stop from De Sanctis, who received the compliments of the man he denied, Antonio Di Natale.
Udinese finally reduced the arrears in the 51st minute when Pinzi was allowed to progress to the edge of the area, from where he shot low into the far corner of the goal.
Just like Pinzi, Torosidis was then allowed to approach the area and shoot from 25 yards low into the bottom right-hand corner, restoring Roma's two-goal advantage in the 69th minute.
For the third time, the visitors went close to an immediate reply when De Sanctis once again denied Di Natale, but the visitors kept up the pressure and pulled another goal back 10 minutes from time when Danilo's header was pushed out by the Roma goalkeeper to Basta, who finally got the better of the last line of the Roma defence from close range.
Alessandro Florenzi wasted the chance to settle Roma's nerves from Pjanic's pass, but Roma held on for all three points, replying to Napoli's win over Torino earlier on Monday to restore their three-point advantage over the Azzurri, with a game in hand.