Mark Byrne put the Bees in front but the Shrimps responded and Carlton's brace gave them three precious points to ease their relegation fears.
McIlroy said: "It was a vital win for us. It was built-up like a do-and-die game, and we had to come here and show that we're ready for the battle and ready to play and I think we did that.
"We started quite brightly and it was a bit of a sucker punch that they got that goal, but we responded and that was fantastic because of the situation that we're in after those two one-nil defeats.
"The boys could have dropped their heads but they didn't. We looked at the Barnet side and I thought we could always hurt them with set-plays and in this game we did.
"Danny Carlton works his socks off and he's been a bit unfortunate since he's come back. He's worked tirelessly hard and he's got a good thing going with little Jimmy Spencer and to get those two goals is a bonus for him because he does so much for the side."
Source: PA
Source: PA