David Nugent struck a late winner for Derby as they came from behind to beat the Reds at a packed Pride Park.
Nugent converted a Matej Vydra cross from close range with just 14 minutes to go as Derby celebrated a first win in seven games.
The Reds certainly had the better of the opening half-hour at Pride Park.
They created the bulk of the chances as their 2,500-strong travelling army of fans roared them on.
The recalled Adam Hammill saw a shot deflected just over the top, while Adam Armstrong’s well-struck curler was superbly saved by Scott Carson.
The Reds pressed hard, and Armstrong again went close when a Hammill corner-kick wasn’t cleared by a static Rams defence.
Hammill was then thwarted by another smart stop from Carson.
The Rams bossed the final 15 minutes of the opening half.
Johnny Russell’s deep cross almost dropped into the far corner of the net, before the same player was then denied by a superb full-length stop from Adam Davies.
The Reds made the breakthrough in the 52nd minute with a rather straightforward goal.
Marc Roberts flung in a long throw-in, and there was Matty James charging in to powerfully head home to register his first Barnsley goal.
The Reds’ lead only lasted a little over two minutes.
The Rams roared back to level as Tom Ince tapped home following a goalmouth scramble.
Josh Scowen almost restored the Reds’ lead, but he lashed wide from an acute angle.
The Rams pushed on in the final 20 minutes, and Ince was denied a second when his close-range shot was brilliantly tipped onto the post by Adam Davies.
The hosts were then rewarded with Nugent’s winner.
Derby (4-3-3): Carson; Christie, Baird, Pearce, Olsson; Vydra (Anya, 84), de Sart (Butterfield, 46), Johnson; Ince, Nugent, Russell (Hughes, 79).
Subs not used: Mitchell, Bryson, Camara, Bennett.
Barnsley (4-4-2): Davies; Jones, Roberts, MacDonald, Yiadom; Watkins, Scowen (Lee, 86), James, Hammill; Bradshaw (Mowatt, 75), Armstrong (Kent, 75).
Subs not used: Townsend, Elder, Jackson, Moncur, Lee.
Referee: Keith Stroud (Hampshire).