Having stunned Manchester City in the Premier League on Sunday, the Welsh club had to be on their guard to prevent being on the wrong end of an upset on Wednesday.
But James Beattie's League Two side, who have yet to register a league victory this season, proved a stern challenge and made it to half-time with the scores level.
However, their resistance was finally broken in the second half when two goals in as many minutes from Nicky Maynard and Rudy Gestede earned Cardiff a trip to West Ham in the third round.
"That could have been a potential banana skin tonight if we hadn't gone out and been professional," Mackay said.
"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."
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.