The decisive goal came in the 39th minute when David Winfield nodded on Marvin McCoy's long throw for veteran skipper Ainsworth to volley home from close range.
Macclesfield were unlucky not to equalise on the stroke of half time when their 20-year-old French defender Tony Diagne lashed a 10-yard drive off the inside of the post and the follow up shot from Paul Bolland was cleared off the line by Stuart Lewis.
Macclesfield began brightly but Wycombe were unlucky not to take the lead on 29 minutes when their top scorer Scott Rendell looped a volley off the crossbar.
After the break Macclesfield striker Tyrone Barnett saw a close-range header again hit the bar with Emile Sinclair going close on 77 minutes with a 20-yard goal-bound volley that ricocheted wide off Barnett.
The game was marred in injury time by a violent 22-man brawl which saw Macclesfield duo Sinclair and Ricky Sappleton along with Wycombe's Winfield all given their marching orders.
Source: PA
Source: PA