Macclesfield claimed a fine 3-1 win at the Racecourse Ground to leave Wrexham without a home victory since early November.
Chances flowed in a bright first half and a diving header from Brian Carey brought a good save from Steve Wilson after five minutes.
Four minutes later, the Silkmen opened the scoring when Wrexham defender Shaun Pejic headed the ball into his own net after Lee Hardy had sent over a cross.
But the home side restored parity after 29 minutes when Paul Edwards skipped past the static Macc defence before teeing up Lee Trundle, who hammered a low shot past Wilson.
Macclesfield's Danny Whitaker then hit the post from a free-kick and a minute into the second period, he set up Matthew Tipton who finished well.
Wrexham nearly equalised again with an audacious lob from Trundle before their substitute Hector Sam hit the crossbar with an acrobatic scissors kick.
But Macclesfield defended stoutly and three minutes before the end secured three points when a mistake by goalkeeper Andy Dibble let in David Eaton, who scored an instinctive goal.