The Azzurri took the lead through Andrea Belotti in the first half, but a quickfire double from the hosts saw Italy needing two goals from Immobile in the final 15 minutes to rescue the win and avoid dropping unexpected points in their bid to reach Russia 2018.
Italy boss Giampiero Ventura made six changes to the team that drew 1-1 with Spain last time out, one of which was enforced after striker Graziano Pelle had been sent home for his reaction to being substituted during the match.
Belotti led the line up front in Pelle's stead, but before the Torino man would have his say on proceedings Italy thought they had broken the deadlock through Antonio Candreva, whose ninth-minute strike was ruled out for offside.
The hosts came within inches of scoring themselves less than 10 minutes later when Ilija Nestorovski let fly from outside the box, but with Gianluigi Buffon beaten, the ball came back off the crossbar.
The opener eventually arrived midway through the half when Federico Bernardeschi's low cross was met by Belotti, who fired his effort high into the net for his first ever international goal.
The visitors by no means had things all their own way, though, and Nestorovski was proving a particular handful for Macedonia, testing Buffon again before half time with a firm header.
Italy began the second half quickly in search of a second goal that would give them a vital cushion, and Immobile almost provided it five minutes after the interval when he danced past two defenders before being denied by Martin Bogatinov.
However, Macedonia, who had lost nine and won none of their last 10 qualifying matches heading into tonight, soon turned the match on its head when Nestorovski this time took his chance, advancing to the edge of the box before passing a precise finish into the bottom corner.
Things quickly got even better for the jubilant hosts when Ferhan Hasani put them in front, lashing home from the edge of the box after seeing a loose ball break to him.
Italy were suddenly staring down the barrel of their first qualifying defeat since 2006 - a run of 52 games - and they needed Buffon to keep them in the match when he turned away a header from Daniel Mojsov.
Macedonia were not able to hold out, though, and Italy levelled things up again with 15 minutes remaining when Immobile got a foot to Candreva's cross to flick it into the bottom corner.
A draw would still have been a disappointing result for the visitors, though, and they set about looking to spare their blushes in the final 15 minutes, with Immobile and Candreva both threatening.
Ventura's side thought they had clinched a winner with just a minute left of normal time when Marco Parolo found the back of the net, but much to Italy's chagrin the goal was ruled out for offside.
However, the decision would not prove quite as contentious as Italy did rescue all three points late on, with Immobile getting on the end of Candreva's looping ball to the back post to nod home the winner from close range.
The victory sees Italy move joint top of Group G, level on points with Spain as the only two remaining unbeaten teams in the group.