GOALS from Devante Cole and Kane Hemmings put the Reds into the next round of the Johnstone's Paint Trophy.
After a poor first half against York, Danny Wilson's men broke the deadlock through Cole in the 63rd minute, before Hemmings grabbed the first goal of his Barnsley career with minutes remaining.
The ex-Rangers striker's 25-yard effort sealed the win in spectacular fashion.
"In the second half, we passed the ball better," said Danny Wilson. "It took a while for the whole team to get going but once we got it into our stride, we saw a difference in the team."