Chris O'Grady scored on his first start for Leicester before a late goal from skipper Patrick McCarthy settled home fans' nerves as the Foxes sealed their passage into the next round.
However, the game was played in front of just 6,298 supporters, the lowest ever crowd at the Walkers Stadium.
City gave debuts to keeper Conrad Logan and centre-back Gareth McAuley while there was a first home start for midfielder Levi Porter while Macclesfield were without the injured Matty McNeil, Dave Morley, Andy Smart and Martin Bullock.
Macclesfield had a half-chance inside two minutes when Colin Heath broke down the left, but dragged his shot wide of Logan's far post.
City enjoyed most of the early possession but struggled to create a clear-cut opportunity. Instead it was the Silkmen who gave the home side another fright on 12 minutes when a McAuley error let in Heath but Logan was quickly off his line to snuff out the danger with Alan Navarro ballooning the loose ball over the bar.
Full-back Richard Stearman had the Foxes' first shot on target when his 30-yard drive extracted a diving save from Jonny Brain.
But there was little the keeper could do to stop City taking a 24th minute lead when a flurry of passes which involved Iain Hume and Stearman set up O'Grady who rifled home from just inside the box.
Despite that setback the League Two strugglers continued to edge forward with Heath rippling Logan's side-netting from 20 yards.
Then, a minute before half-time, Jamie Tolley broke from midfield to test Logan from distance.
After the restart it was one-way traffic towards Town's goal but again City struggled to find sight of goal with only long-range efforts from Alan Maybury, Josh Low and Gareth Williams to show for their efforts.
City sub Stephen Hughes then played in O'Grady who hit a rising shot over the bar as City searched for a nerve-settling second goal.
It almost came with four minutes remaining when Maybury turned on a Porter pass with the keeper saving with his feet and then a minute later Brain repeated his heroics, this time diving to block Porter's fierce drive.
Leicester had to wait until the 89th minute to wrap up the tie when McCarthy rose at the far post to head home a Williams corner.