But the win potentially came at a cost when skipper Billy Sharp limped off in the second half, adding another headache for boss Paul Heckingbottom in a season of injury struggle so far.
United were far from at their best in the first half against Barnsley, who could have gone ahead early on when Matty Wolfe saw an effort well saved by Wes Foderingham.
But the home side went ahead perhaps against the run of play when Sander Berge converted from close range, and Morgan Gibbs-White put the gloss on victory after going around Brad Collins and slotting home after good play from substitute Oli McBurnie.
1. Wes Foderingham 7
Made a top early save to keep out Matty Wolfe's effort when the Barnsley man was getting ready to wheel away in celebration. Gave United the foundation for a vital victory Photo: Andrew Yates
2. Ben Osborn 6
Had a good opportunity late in the second half when he was fed by Berge, chopped inside onto his favoured left foot and curled an effort just wide. Another solid shift out of position Photo: Darren Staples
3. Kyron Gordon 6
Could have had his first goal in United colours in front of the Kop but Berge reacted quicker to finish from Hourihane's cross. Another solid performance from the young man Photo: Darren Staples
4. John Egan 6
Another game, another clean sheet and another commanding display from Egan, up against a difficult opponent in Morris Photo: Andrew Yates