Milan lead on 61 points with Roma on 56, while champions Juventus, who won 3-2 at Brescia on Saturday, are a further point behind in third place.
Andrea Pirlo put Milan ahead in the 17th minute but Cristiano Doni brought the enterprising visitors level 10 minutes later.
A header from Filippo Inzaghi before the break and then a well-taken goal from Brazilian Kaka in the second half ensured Carlo Ancelotti's side's 10th win from their last 11 league games.
Roma's victory was not as emphatic as the result suggests, with two of the goals coming in the final three minutes after Inter's Ivan Cordoba had been sent off.
But another outstanding performance from striker Antonio Cassano ensured Inter's fourth straight league defeat despite one of their better displays in recent weeks.
Lazio's game at Bologna was postponed due to snow but Roberto Mancini's side remain in fourth place.
LIVELY FOOTBALL
After some sparkling moves in the opening minutes, Milan went ahead through Pirlo's 25-metre drive which flew in off the inside of the post.
While Milan were producing some lively attacking football, Sampdoria, the surprise package of the season so far, were always dangerous going forward and, in contrast to many visitors to the San Siro, were keen to play positively.
Milan keeper Dida needed to be quick off his line to foil Aimo Diana in the 24th minute and then three minutes later the visitors drew level when Doni slammed home the loose ball after Gennaro Gattuso cleared a Diano effort off the line.
Ten minutes before the break Milan restored their lead when Inzaghi rose superbly to meet a Giuseppe Pancaro cross with a perfectly angled glancing header at the near post.
Inzaghi, who has only recently returned from injury, looked sharp and moments later he almost added his second with a low diagonal shot that flashed across the face of the goal.
Three minutes after the restart, Kaka latched on to a through ball from Pirlo and made himself enough space for a low shot past former Milan keeper Antonioli to make it 3-1.
"It was a very open and entertaining game. Sampdoria are not easy to play against but we were at our best today," said Ancelotti. "The teams behind us are not giving up and that is what worries us."
'GOALS' DISALLOWED
Proof of that came with Roma's latest goal spree -- following their recent hammerings of Siena and Parma they have now hit 14 in three games.
Fabio Capello's side had three 'goals' disallowed before Cassano put them ahead on the stroke of halftime with a composed finish after a sublime through ball from his strike partner Francesco Totti.
Brazilian Mancini doubled Roma's lead in the 63rd minute with a superb solo goal, latching on to a Cassano pass and bursting into the area before firing home.
Inter got themselves back into the game 10 minutes later when Obafemi Martins' shot took a deflection and looped to Christian Vieri at the back post who volleyed past Ivan Pellizzoli to make it 2-1.
Alberto Zaccheroni's side pushed forward in search of an equaliser but were caught at the back again when Cassano broke free of Cordoba and the Colombian defender barged him over inside the area conceding a penalty and receiving a red card.
Totti smashed home the spot-kick to ensure the three points but there was still time for more Cassano magic when he turned Thomas Helveg and slipped the ball across the goal to Mancini, who tapped in from close range.