The two clubs are separated by 81 places in the Football League pyramid and, with the Bluebirds buoyed by Sunday's 3-2 victory over Manchester City and Stanley winless in League Two, few gave the hosts much hope.
Yet for 45 minutes they held out until two second-half goals in the space of 85 seconds from Nicky Maynard and substitute Rudy Gestede sealed the 2012 finalists' place in round three.
"That could have been a potential banana skin tonight if we hadn't gone out and been professional," said Mackay, who rested all of the XI which started against City.
"We knew they were going to try and pack the area and make it difficult for us. We had to keep shifting the ball from side to side and eventually little gaps open up, which is what happened.
"As the second half wore on we were increasingly influential and looked as if we were going to score."
It needed a moment of brilliance from Maynard to break the deadlock as the former Bristol City striker flicked the ball over his head before coolly slotting home on the hour.
Gestede's first-time finish moments later was another indication of the Premier League outfit's class and, particularly with summer signing Andreas Cornelius coming off injured in the first half, the form of his strikers pleased Mackay.
The Bluebirds boss, who does not believe Cornelius' injury is too serious, added: "Nicky Maynard's first goal was fantastic. The second one as well; a great ball from Jordon Mutch and the finish from Rudy Gestede as well.
"I'm delighted for the boys tonight. They applied themselves really well and if they hadn't, that could have caused us a problem."
For Accrington boss James Beattie, attention will now turn to attempting to steer his side off the foot of the fourth tier.
The performance of his injury-ravaged squad against such illustrious opposition has given him plenty of hope that they can do just that.
"The lads are disappointed in there," said the ex-Everton forward.
"There's no shame in that performance at all. I thought it was very good. All the units were working a lot better tonight, the shape was good, the discipline was good.
"They can hold their heads high, I've told them to walk out that dressing room with their chests out and their chins held high."
Beattie, who was handed his first job in management at the Crown Ground back in May, even went as far as claiming it was the best he had seen his side play.
"I would put it up there with the Middlesbrough performance (in the last round when Accrington won 2-1)," he said.
"Now we just need to replicate that Capital One Cup performance in the league and there'll be no problem whatsoever."