The npower Championship leaders went into the match 81 places above Steve King's side in the pyramid but made 11 changes and were made to pay the price.
When Nathaniel Jarvis prodded home on 57 minutes it looked to be going to script for Cardiff but then Matthew Barnes-Homer stabbed home Jack Mackreth's cross before converting from the penalty spot after Jarvis was penalised for pulling the shirt of Pablo Mills to give the Silkmen a 2-1 win.
Mackay said: "We picked a team here that we felt was capable of winning the game and I thought there were some fantastic performances.
"They got to five minutes to go and they just switched off and that lost us the game - but they will learn from that.
"I don't regret picking this team, I think they did wonderfully.
"I thought all the youngsters at the back were fantastic and Declan John has shown he has exceptional potential for Cardiff going forward.
"Both teams tried to play the ball but Stephen McPhail has that extra bit of class which really helped the youngsters.
"We have a dressing room of very disappointed players but they should be proud of the performance they put in.
"We can now get our head in the league but I want to wish Macclesfield good luck in the next round, they were fantastic."