Newcastle United survived a late goal to advance into the third round of the Checkatrade Trophy on penalties.
Elias Sorensen netted his 18th goal of the season in the opening half-hour in what looked to be a comfortable win for Ben Dawson's side.
Unfortunately, a lapse in concentration allowed Scott Wilson to equalise and send the game to penalties with five minutes remaining.
However, the Magpies recomposed themselves for spot-kicks as Mo Sangare dispatched the winning spot-kick to inflict a defeat on Sol Campbell's managerial bow.
With much made about Campbell's first game in charge of Macclesfield, the visitors went on to make the brighter start, though without fully testing Nathan Harker.
The only exception fell when James Pearson flicked Malachi Napa's corner goalwards with Tom Allan required to clear the attempt off the line.
Newcastle slowly eased into the tie and cemented their authority when Sorensen bundled home his fourth Checkatrade goal in as many games on 24 minutes.
Callum Roberts was instrumental in the build-up as it was his power and pace through the middle that allowed Gibson to supply the cross for the opener.
The hosts' lead was barely threatened as only the legs of Kieran O'Hara prevented Roberts and Adam Wilson from extending their side's advantage.
However, Harker did ever so well to stop Wilson from equalising before the break, denying him one-on-one after latching on to Koby Arthur's ball in-behind.
Right at the start of the second-half, Sorensen squandered a golden chance to net his second of the evening - curling wide after Keith Lowe's misplaced backpass.
But while Sorensen and his teammates endured a fairly quiet evening in front of goal, Macclesfield seemed to have suffered similar fate only for S.Wilson to level in the closing stages by looping the ball over Harker.
It was to be decided via spot-kicks. Harker saved Ben Stephenson attempt before Sangare scored the fourth and decisive spot-kick.
NEWCASTLE UNITED U23s: Harker, Walters, Gibson, O'Connor, Bailey, Allan (Longelo 64), Watts, M.Longstaff, Sorensen (Sangare, 78), Roberts, Wilson (Toure 73). Subs not used: Huuhtanen, Juanito.
MACCLESFIELD TOWN: O'Hara, Pearson (Stephensen 75), Lowe, Grimes, Arthur, Napa (Poticelli 55), Maycock, Evans, S.Wilson, Welch-Hayes, Blissett (Smith 66). Subs not used: Durrell, Kelleher, Lloyd, Whitaker.
Goals: Sorensen 24, Wilson 85
Referee: Ben Toner