Inter, who have lost only once in the league this season, have 30 points from 13 games.
Spezia, making their Serie A debut this season, held out until the 52nd minute when Hakimi latched onto Lautaro Martinez's pass, sped away and scored with a shot which appeared to catch goalkeeper Ivan Provedel off his guard.
Lukaku added the second from a penalty in the 71st minute, his 11th league goal of the season, after M'Bala Nzola's handball.
Inter appeals were initially waved away but the referee changed his mind after reviewing the incident on the pitchside monitor.
Roberto Piccoli pulled one back for the visitors in stoppage time, but too late to threaten Inter's win.