Wales striker Jermaine Easter's first goal for Swansea City earned Brendan Rodgers' Championship play-off chasers their first home victory for six weeks.
The loan signing from Milton Keynes Dons pounced after superb build-up play between Nathan Dyer and Stephen Dobbie.
Easter, making his first Swans start, later hit the crossbar while his side had a second-half penalty appeal turned down after Scott Sinclair went down.
But out-of-form Swansea held on to secure their first win in four games.
And Rodgers' men moved level on points with second-placed Cardiff and fourth-placed Leeds United with a solid victory against one of the Championship's form sides.
Easter, who completed an emergency deadline-day loan move from League One Dons, will have done his chances of earning a permanent January switch to the Liberty Stadium no harm with a close-range finish.
Barnsley had lost just one in their last six but Easter ensured The Tykes fell to consecutive defeats over the festive period -dropping to 16th in the table - with a first-half winner.
Dobbie had gone close for Swansea early on when the Scottish striker drilled right of target from 18 yards.
Brendan Rodgers praises Swans 'steel'
The hosts, who had been hammered 4-0 by leaders Queens Park Rangers on Boxing Day, dominated the opening exchanges.
And Dyer forced a parried save from Barnsley stopper Luke Steele during a period of play in which they enjoyed six corners in five minutes.
Adam Hammill then forced a save from Swans stopper Dorus De Vries but that proved mere brief respite before the Swans broke the deadlock.
Dyer found enough space on the right side of the penalty area and picked out Easter from six yards who pounced to convert his first goal since August.
Easter was close to scoring a double but he saw his header from 12 yards rebound off the bar.
Barnsley started the second-half with vigour and inside the opening 60 seconds Jim O'Brien had tested the reflexes of De Vries.
Dobbie, meanwhile, continued to pose a threat for Swansea and it was he who almost grabbed the second goal the home side craved when Steele tipped his close-range shot around a post after 71 minutes.
De Vries was soon called into action as he kept out Goran Lovre's header and Paul Hayes' drive as the visitors pushed for an equaliser.
But Swansea held on and man-of-the-match Dyer could have added a second but for another impressive Steele stop.
But De Vries had to save smartly from Jacob Butterfield after the Barnsley substitute's 20-yard effort in the fifth minute of injury time to ensure the Swans kept their eighth home clean sheet this season.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.