Martinez had his goal ruled out by VAR due to a narrow offside call, and De Vrij and Perisic both squandered golden opportunities.
Inter, on the other hand, were not to be denied for long, as Bastoni’s spectacular 25-yard strike gave them the lead.
Lazio had been struggling up until this moment, but they responded quickly as Immobile took advantage of defensive misunderstanding to score.
Inter, at the other end, stayed on track and took the lead after the break when Skriniar headed home Bastoni’s cross.
Milan Skriniar’s match-winning goal was Inter’s 13th headed goal in Serie A this season, more than any other team in the top five European leagues.
Lazio applied late tension, but it wasn’t enough to prevent Inter from securing a critical three points.
As a result of the match, Inter moves ahead of AC Milan to regain first place. Lazio is still in seventh place.