The Bosnia captain's powerful header 10 minutes after the break was enough to end Napoli's unbeaten record and put Inter eight points away from the pacesetters.
Simone Inzaghi's side sit fourth and are back in the discussion for the Scudetto after their third straight league win, one which puts some pressure on a Napoli team who threatened to run away with the league before the World Cup.
Second-placed AC Milan were the main beneficiaries of their local rivals' win at the San Siro, their title defence boosted by a 2-1 win at Salernitana in the day's first match.
Also lurking are Juventus, who sit third and a further two points off the pace following their last-gasp 1-0 win at Cremonese.
Inter should have been ahead before Dzeko netted the winner, with Matteo Darmian wasting a perfect lay-off from the Bosnia captain midway through the first half when he smashed over the bar.
An underwhelming Romelu Lukaku also shot over as Inter failed to fully capitalise on their clear superiority over a disappointing Napoli, and they almost paid the price when Giacomo Raspadori's late shot was well-saved by Andre Onana.