Jacob Mellis' late strike gave the visitors a few late scares, but early goals from Ben Nugent and Aron Gunnarsson proved enough to condemn the Tykes to a fifth defeat in six games.
"It was just good to have another three points, coming to a tough ground," Mackay said.
"We were playing against a team that has a fresh influx of players through the week, so we always knew it was going to be difficult. I am delighted to come away from here having been clinical and getting the three points.
"We were quite comfortable and in the second half we started really well and on another day could have had another two or three goals had we picked them off on the counter attack."
On the impressive 19-year-old Nugent, Mackay added: "He is very calm and composed, from day one of pre-season he has been excellent.
"He is desperate to do well and work hard and if he keeps improving eventually Cardiff will have a very good player on their hands. But he has to keep listening."