The Nerazzurri came into the match on the back of an impressive form having won two and drawn one of their last three Serie A matches.
Despite controlling much of the possession, Inter failed to capitalize on their dominance and it was the home side that opened the scoring in the 31st minute when Luca Ceppitelli outjumped the Inter defence to head home.
However, Inter were back on level terms seven minutes later when Lautaro Martinez got on the end of a whipped cross from Radja Nainggolan to score from close range.
The scoreline changed again five minutes later with the home side restoring their lead before the break – Leonardo Pavolleti showing good composure inside the box to fire a first-time shot into the bottom right corner to make it 2:1.
Cagliari came back for the second half with just one agenda in mind, defence and it paid off with the visitor’s attack unable to get an equalising goal.
Rolando Maran’s men came very close to grabbing a third goal when Milan’s Skriniar conceded a penalty in the first minute of added time but Nicolo Barella skied the ball over the bar and into the stands.
Both AS Roma and AC Milan now have a chance to leapfrog Inter on the table when they play Lazio and Sassuolo respectively on Saturday.