Paul Harsley scored his first goal for more than a year to end Macclesfield's nine match winless streak and ease the pressure on manager John Askey.
But it was the performance of referee Graham Salisbury which had both bosses fuming after the match.
While Askey was convinced that the Silkmen had two clear penalties turned down, Swansea manager Brian Flynn was angry with the referee for sending off on loan West Ham defender Shaun Byrne midway through the second half for kicking out home striker Jonathan Parkin.
Flynn said: "I've seen the video of the sending off incident and there is a petulant kick there from Byrne. Their player had tried to stop us taking a throw in, but Shaun has made very little contact, yet the ref is saying it was violent conduct.
"You could look at it and see in the same way as the David Beckham incident against Argentina in the 1998 world cup. I know it was a different scenario, but the referee has compounded his error here by giving the throw in to them.
"The referee has got two major decisions wrong tonight" Macclesfield started the brighter and scored after eight minutes when Matthew Tipton turned in Martin Carruthers's right wing cross from close range.
Swansea fought back with Andy Robinson testing Macclesfield keeper Steve Wilson with a low near post drive, and Michael Carr launching a spectacular overhead kick to clear the danger as Wilson flailed at a Leon Britton cross.
But the home side should have gone two up before the interval when Tipton's shot hit the cross bar, Carruthers's follow up was blocked on the line seemingly by the hand of defender Alan Tate, and then Parkin missed his kick with the goal at his mercy.
The sending off of Byrne rocked Swansea and within 60 seconds Paul Harsley had blasted Macclesfield into a 2-0 lead from a tight angle following excellent approach work from Tipton.
But Brad Maylett gave the visitors when he blasted a shot into the top corner of the net from 25 yards.
And the 10 men could have equalised near the end, but the Silkmen held on for the victory.
A delighted Askey said afterwards: "I just felt it was a do or die game for us tonight. It was one we just had to win so we went to try and put Swansea under pressure from the start and that's what we did.
"I think the spirit of the side has always been there and we have always shown 110% commitment, we've got a good bunch of lads here and we will try all we can to stay up.
"The only thing that matters is survival - if I can help us stay up then all well and good but if somebody else comes in and ensures we stay up that's all well and good too."