Mirko Vucinic put Roma in front in the 18th minute, but the first red card to Roma goalkeeper Julio Sergio and a consequent penalty allowed Sampdoria to level through Nicola Pozzi in the 58th minute.
Stefano Guberti put the home side in front in the 83rd minute, taking advantage of the second costly error of the game from Juan, before Sampdoria lost both central defenders Stefano Lucchini and Daniele Gastaldello to late dismissals.
They still managed to hold on to relieve the pressure on their coach Domenico Di Carlo with an important home win.
Pozzi missed Sampdoria's first chance of the game in the 11th minute, although Guberti's cross was just a touch behind him, making it hard to find the target.
Vucinic had an equally difficult task of finding the target in the 18th minute, and few would have expected him to shoot as he skipped past Stefano Lucchini down the right. But rather than searching for Marco Borriello in the centre, he struck the ball across the face of Gianluca Curci and into the far corner.
The response from Sampdoria came immediately, with Reto Ziegler curling a 35-yard free-kick just inches wide of the post.
A good move involving Jeremy Menez and Vucinic at the other end paved the way for Borriello to test Curci, who got his fingertips to the ball to push the Roma striker's shot wide of the far post.
Guido Marilungo should have brought Sampdoria level on the stroke of half time, but he failed to beat Julio Sergio after breaking the offside trap to latch on to a long ball forward.
The game turned on a penalty decision in the 55th minute as Angelo Palombo pounced on a glaring error from Juan to nudge the ball past Julio Sergio and fell down after the faintest of contacts.
The Roma goalkeeper was sent off and Pozzi blasted the spot-kick past his replacement Doni to bring Sampdoria level.
New signing Federico Macheda, on loan from Manchester United, made his entrance in the last 10 minutes as Sampdoria tried to make their one-man advantage count and he almost made a dream debut but headed wide from six yards out.
Sampdoria went ahead in the 83rd minute when another terrible error from Juan gifted the ball to Guberti, who beat Doni inside his near post.
The home side were reduced to 10 men three minutes later when Lucchini saw his second yellow card and Gastaldello followed him down the tunnel in the last minute as he too was handed a second booking.
However, even with Francesco Totti on the field, Roma were unable to find an equaliser against nine-man Sampdoria, who held on to all three points.