The hosts trailed 1-0 at half-time, but came back strongly after the break as their opponents lost their discipline.
Gianni Munari put Samp in front in the 20th minute, but the game turned early in the second half when Andrea Costa was sent off for a foul on Diego Milito in the area and the Argentinian levelled from the spot.
Rodrigo Palacio made it 2-1 in the 69th minute and Fredy Guarin added a third nine minutes from time.
Samp then lost their discipline as coach Ciro Ferrara was sent to the stands and substitute goalkeeper Tommaso Berni was also shown a red card, both for dissent.
The visitors still managed to pull one back in the last minute through Citadin Eder, but it was too little too late.
The win moved Inter above Napoli into second and kept them four points behind leaders Juventus.
Samp got off to the better start and went ahead when defender Andrea Ranocchia failed to clear a free-kick from Andrea Poli and the ball fell to Munari to score from close range.
Antonio Cassano fired narrowly wide of the left post and Guarin was also off target from long range as Inter looked to respond.
Milito should have levelled a minute before the break, but contrived to miss from inside the six-yard box after a cross from Javier Zanetti.
But the hosts were handed a way back into the match six minutes after the break as Costa was shown a straight red for a foul on Milito, who fired home the penalty via the inside of the post.
And Palacio put them ahead after being set up by Cassano following poor defending from Renan Garcia.
Guarin made it three as he converted a pass from Milito before the action turned to the touchline.
Ferrara and Tommaso Berni were red carded for dissent, but, far from throwing in the towel, the sense of injustice seemed to galvanise Samp.
Eder reduced the deficit to one with a smart finish deep into stoppage time, but there was no time to get a leveller.