Super-sub Wayne Andrews grabbed a late winner with his first touch after coming off the bench to silence some disgruntled Coventry City fans.
Sky Blues boss Micky Adams brought on Andrews for Leon McKenzie seven minutes from time, sparking a chorus of 'You don't know what you're doing' from the travelling fans.
But the City manager had the last laugh seconds later when Andrews collected the ball from a throw-in, cut inside Paul Reid and rifled a low angled shot beyond Nick Colgan.
In a scrappy first half both sides had chances to break the deadlock.
Barnsley had a scare in the first minute when Colin Cameron whipped in a curling corner to the near post that Colgan just managed to hold.
Kevin Kyle missed the target with a header after being picked out by Cameron's cross, before Dele Adebola hooked an ambitious volley over the top.
Barnsley were on the back foot again when Kyle went powering through, but when the ball broke he hoisted a wayward volley high over the top.
The hosts came back with a threat of their own when Marc Richards angled a shot in from the right, before Paul Hayes shot straight at goalkeeper Andy Marshall after being played in by Michael Mcindoe.
Marshall then had to produce a save diving full stretch to his left when Sam Togwell threatened to break the deadlock with a sizzling goal-bound shot from 25 yards.
His opposite number Colgan did brilliantly to keep out Coventry when Brian Howard's mistake let in Richard Duffy, who exchanged passes with Adebola on the edge of the box, only to see the goalkeeper dive bravely at his feet.
And three minutes before the break Barnsley squandered a glorious chance when Bobby Hassell's cross found Richards, but his header was straight at the keeper.
Ten minutes into the second half McIndoe hit a shot on the turn that flew over the top, before Richards teed up Hayes to fire a long-range volley too high.
But after 65 minutes, only a desperate goal-line clearance kept out the home side.
Marshall dropped Togwell's long throw and McIndoe nipped in to head goalwards, but Elliott Ward cleared off the line.
But with time running out, Andrews struck to secure the points.