The Tykes were the first to threaten when Winnall capitalised on a mistake in the Town defence and fired at goal from 25 yards, but his strike went narrowly wide of the post.
The home side levelled the scores as Dempsey committed a huge error when his back-pass was seized upon by Winnall, who smashed his shot past Smithies.
In the second half, Barnsley took the lead when Holgate was allowed to turn inside the box after collecting the ball from a corner and beat Smithies with a low effort.
Conor Wilkinson nearly found a third goal for the hosts when he raided inside the area and curled an effort over Smithies, only to see his strike crash off the crossbar.
The Terriers made a late push to get back into the game, but Joe Lolley's late effort from close range was deflected over the bar as his side fell to a narrow defeat.