Second half goals from debutant George Waring and dubious penalty from Conor Hourihane secured the points for the Tykes.
Town made two changes to the starting line up that was defeated by Manchester United in third round of the FA Cup.
Both Kevin Dawson and Simon Gillett missed out through injury and were replaced by Ajay Leitch-Smith and James Berrett.
Town started brightly forcing numerous corners and free kicks around the Barnsley penalty area.
After just four minutes, keeper Jed Steer had to be on his toes to tip over a Mason Holgate cross that got caught in the wind.
At the other end Town’s first real chance after 17 minutes when a Sam Foley cross was flicked on at the front post by Stephen Arthurworrey into the path of Kieffer Moore. The former Dorchester man couldn’t quite get the connection he wanted and the ball fell into the hands of keeper Ross Turnball.
Five minutes later the Glovers had another superb chance to take the lead. A lack of concentration at the back by Jean-Yves M’Voto saw Leitch-Smith race clear, but his shot went narrowly wide of the upright.
With 25 minutes on the clock Town were reduced to ten men when Ben Nugent received a straight red card. The Cardiff City loanee and Barnsley striker Waring tussled in the centre circle and referee Bankes saw some foul play to send Nugent for an early bath.
Five minutes into the second half the home side took the lead. A cross from the Barnsley right was met at the back post by Holgate who nodded into the path of Waring, who volleyed home into an empty net.
On 75 minutes the home side were awarded a penalty when referee Bankes pointed to the spot after he thought Steer fouled Hourihane in the area. Despite the claims from the Town players that Steer won the ball, the referee was adament he fouled the Barnsley captain.
The former Plymouth Argyle midfielder dusted himself down to send Steer the wrong way and make the score 2-0.
Town now face a home fixture againt Bradford City on Saturday 17th January.