Maguire had two chances to add to his tally in the first half but he drilled one long-range effort wide before seeing another shot cleared off the line by Steve Williams.
Macclesfield were handed a great opportunity to level the scores in the 65th minute when Joe Mattock was adjudged to have handled the ball inside the box and Scott Boden stepped up from 12 yards to calmly slot the ball past Martinez.
Despite being put on the back foot for most of the game, Macclesfield came agonisingly close to taking the lead when Scott Kay rattled the crossbar with a powerful strike.
Maghoma made up for his earlier miss by scoring his side's second in the 77th with a low finish past a helpless Taylor.
Jermaine Johnson drilled in from the edge of the box to extend Wednesday's lead in the 85th minute and Miguel Llera completed the victory with a header in stoppage time as the hosts booked their spot in the next round.