Huddersfield's B team led the way to success in a drab Yorkshire derby.
Striker Andy Booth and young defender Nat Brown were both outstanding as struggling Town grabbed a priceless victory in their battle to beat the drop to Division Three.
Huddersfield's under fire boss Mick Wadsworth said: "This was an excellent result - in my second spell as manager! "The players performed really well and we created chances that had to rely on just the one taken.
"Our back three players were outstanding. Young Brown has a fantastic chance of being a fantastic player. And Andy Booth led the line superbly up front and got a deserved goal and could have had a hat trick.â€ Huddersfield began brightly and should have scored after just three minutes when poor defending let Martin Smith through on goal but his shot was blocked by advancing keeper Andy Marriott.
Booth opened the scoring in the 25th minute when he connected with a right wing cross and sent a header soaring over Marriott who was caught a yard too far off his line.
The nearest Barnsley came in the first half was a 12-yard header from midfielder Alex Neil which Town keeper Phil Senior pushed onto the post and Bruce Dyer failed to connect with the follow-up.
Barnsley were the better side in the early stages of the second period but it was Huddersfield who had a golden chance to make it 2-0 on 58 minutes, Brown swivelling six yards from goal but sending a shot straight at Marriott.
The home keeper then made a good save from Simon Baldry, before Booth headed inches wide of the far post.
Barnsley almost snatched an equaliser in the second minute of stoppage time.
Former Terriers midfielder Dean Gorre saw his 20-yard half volley take a deflection, but keeper Senior pulled off a remarkable save and Dyer's follow-up header crashed against the post, rolled across the six yard box and was cleared by the covering Kevin Sharp.