Derby ended a run of eight games without a win against Barnsley to secure their first back-to-back victories in 24 league matches.
The Tykes looked on course to extend their unbeaten run against the Rams until James O'Connor's close-range finish in the 69th minute.
Substitute Nathan Tyson settled the game with a superb 20-yard drive.
Derby move up to ninth in the table but Barnsley's third straight defeat leaves them a place above the bottom three.
With just 15 goals from 15 league games this season, it is clear to see where the Tykes' problem lies.
While they were able to hold the Rams at bay for a large portion of the game, Keith Hill's side did little to really test home keeper Adam Legzdins.
The closest they came to finding the net was a smart shot from former Rams midfielder Tomasz Cywka that Legzdins turned over the top and a Chris Dagnall drive blocked by the keeper.
Derby created more but were often found wanting when it came to finishing.
In the first half, Conor Sammon produced a neat turn in the area but fired over from 10 yards before both Will Hughes and Jeff Hendrick drew neat saves from visiting goalkeeper Luke Steele.
County were angered when their penalty appeals for what they perceived as a foul on Craig Bryson in the box were waved away in the 55th minute.
But 14 minutes later, O'Connor finally made the breakthrough when he latched onto Richard Keogh's header to fire home and Tyson settled the game with his late strike.
Derby manager Nigel Clough says Nathan Tyson will have to wait for a starting chance up front despite scoring the Rams' second goal: "It was a lovely way to finish and meant we were not sweating going into the last few minutes.
"Everyone has to play their part and it's absolutely vital that even when they come off the bench, they contribute.
"He's pressing for a start but the front two have played so well that he understands it's difficult for him to get in so all he can do is keep doing what he did tonight, put a goal in when he comes on and be a nuisance.
"You never know we might get an injury in training this week and then he's ready to come in."
Barnsley boss Keith Hill: "We give the opposition to much encouragement with silly free-kicks but it's marginal whether you win, lose or draw depending on the decisions players make.
"I set a framework out but the players have to make decisions within that.
"The players have given me everything they possibly could but when we create chances we've got to convert or at least hit the target and when we defend free-kicks we've got to make sure we clear them.
"The players have got to make better decisions on behalf of me and I can't play that game for them. We are looking for them to progress by making less mistakes and to be more assertive in front of goal."
Sorry, we were unable to load match stats, please try again.
Live Text Commentary
Full Time The game is over, as the referee blows his whistle.90:00 +3:50
Centre by Jim O'Brien, free kick awarded for a foul by Marlon Harewood on Adam Legzdins. Adam Legzdins takes the free kick.90:00 +2:51
Jim O'Brien sends in a cross, Chris Dagnall takes a shot. Comfortable save by Adam Legzdins.90:00 +2:26
Foul by Nathan Tyson on Scott Golbourne, free kick awarded. Scott Wiseman takes the free kick.90:00 +0:59 Substitution
Substitution Kieron Freeman replaces Paul Coutts.89:23
The assist for the goal came from Craig Bryson.89:23 Goal scored
Goal! - Nathan Tyson - Derby 2 - 0 Barnsley Nathan Tyson gets on the score sheet with a goal from just outside the penalty box high into the middle of the goal. Derby 2-0 Barnsley.89:09
Tom Kennedy sends in a cross, clearance by Richard Keogh.87:49
Inswinging corner taken left-footed by Tom Kennedy from the right by-line, Effort on goal by Stephen Dawson from deep inside the area goes harmlessly over the bar.87:23
Tom Kennedy takes the inswinging corner, Richard Keogh makes a clearance.85:48
The ball is delivered by Jim O'Brien, James O'Connor manages to make a clearance.83:39
Inswinging corner taken from the left by-line by Michael Jacobs.83:28
Nathan Tyson takes a shot. Blocked by Jimmy McNulty.82:45 Substitution
Substitution Nathan Tyson replaces Conor Sammon.81:37
The ball is crossed by Marlon Harewood, clearance by James O'Connor.77:37 Substitution
Substitution Marlon Harewood on for Jacob Mellis.77:37 Substitution
Substitution Jim O'Brien replaces Kelvin Etuhu.77:37
Scott Golbourne challenges Conor Sammon unfairly and gives away a free kick. Richard Keogh takes the direct free kick.77:00
The ball is crossed by Jacob Mellis, clearance by James O'Connor.74:25 Substitution
Substitution Theo Robinson leaves the field to be replaced by Michael Jacobs.
Booking Martin Cranie is shown a yellow card for unsporting behaviour.74:10
Free kick awarded for a foul by Martin Cranie on Conor Sammon. Free kick taken by James O'Connor.74:01
Scott Golbourne delivers the ball, Richard Keogh manages to make a clearance.70:54 Substitution
Substitution Matty Done on for Tomasz Cywka.70:54
Foul by Theo Robinson on Tom Kennedy, free kick awarded. Jimmy McNulty restarts play with the free kick.70:16
Tomasz Cywka has an effort at goal from just inside the box that misses to the right of the goal.68:18
The assist for the goal came from Richard Keogh.68:18 Goal scored
Goal! - James O'Connor - Derby 1 - 0 Barnsley James O'Connor scores a goal from inside the six-yard box low into the middle of the goal. Derby 1-0 Barnsley.67:27 Booking
Booking Booking for Tom Kennedy for unsporting behaviour.67:06
Free kick awarded for a foul by Tom Kennedy on Conor Sammon. Will Hughes takes the direct free kick.64:30
John Brayford produces a right-footed shot from the edge of the box and misses to the right of the target.62:39
Gareth Roberts fouled by Chris Dagnall, the ref awards a free kick. Gareth Roberts restarts play with the free kick.62:02
Theo Robinson has an effort at goal from the edge of the area that misses to the right of the target.59:49
Shot on goal comes in from Paul Coutts from the free kick, save by Luke Steele.59:49 Booking
Booking Jacob Mellis is cautioned.59:40
Free kick awarded for an unfair challenge on Jeff Hendrick by Jacob Mellis.56:15
Richard Keogh takes the free kick.56:15 Booking
Booking Tomasz Cywka is shown a yellow card for unsporting behaviour.55:58
Stephen Dawson concedes a free kick for a foul on Will Hughes.55:48
Chris Dagnall takes a shot. Save by Adam Legzdins.53:02
Stephen Dawson concedes a free kick for a foul on Craig Bryson. Richard Keogh restarts play with the free kick.51:53
Headed effort from deep inside the penalty area by James O'Connor goes harmlessly over the crossbar.51:06
Free kick awarded for an unfair challenge on Will Hughes by Tom Kennedy. Free kick taken by Paul Coutts.50:44
Chris Dagnall fouled by Craig Bryson, the ref awards a free kick. Stephen Dawson takes the free kick.49:51
Corner from the left by-line taken by Paul Coutts, clearance by Jimmy McNulty.49:20
Jacob Mellis sends in a cross, save made by Adam Legzdins.48:59
Inswinging corner taken by Jacob Mellis from the left by-line.48:47
Tomasz Cywka takes a shot. Richard Keogh gets a block in.48:11
Martin Cranie fouled by Theo Robinson, the ref awards a free kick. Tom Kennedy takes the direct free kick.47:57
Centre by Chris Dagnall, save by Adam Legzdins.46:54
Outswinging corner taken left-footed by Will Hughes from the left by-line to the near post, clearance made by Tom Kennedy.46:27
Corner taken right-footed by Paul Coutts, Jimmy McNulty makes a clearance.45:01
The referee starts the second half.45:00 +1:04 Half time
Half Time The referee blows for half time.43:29
The ball is delivered by Gareth Roberts, Conor Sammon concedes a free kick for a foul on Luke Steele. Luke Steele takes the free kick.42:43
Foul by Jacob Mellis on John Brayford, free kick awarded. Paul Coutts restarts play with the free kick.41:26
Jeff Hendrick takes a shot. Save by Luke Steele.41:08
Will Hughes takes a shot. Save by Luke Steele.39:57
Effort on goal by Jacob Mellis from just outside the area goes harmlessly over the target.39:00
Centre by Tomasz Cywka.37:17
Effort from the edge of the area by Tomasz Cywka goes wide of the right-hand upright.36:54
Inswinging corner taken right-footed by Jacob Mellis from the left by-line, save by Adam Legzdins.36:26
Corner taken left-footed by Tom Kennedy, clearance made by James O'Connor.35:49
Corner taken right-footed by Jacob Mellis from the left by-line, clearance made by Conor Sammon.35:38
Tomasz Cywka takes a shot. Save by Adam Legzdins.35:03
Free kick awarded for an unfair challenge on Jacob Mellis by Jeff Hendrick. Direct free kick taken by Jacob Mellis.33:01
Foul by Martin Cranie on Craig Bryson, free kick awarded. Paul Coutts takes the direct free kick.32:43
Centre by Conor Sammon.31:54
John Brayford delivers the ball, Jimmy McNulty manages to make a clearance.31:28
Free kick awarded for a foul by Martin Cranie on Craig Bryson. Craig Bryson restarts play with the free kick.29:09
Free kick awarded for an unfair challenge on Jeff Hendrick by Stephen Dawson. Richard Keogh takes the free kick.27:54
The ball is crossed by Tom Kennedy, Richard Keogh manages to make a clearance.26:33
The ball is swung over by Kelvin Etuhu, clearance by Richard Keogh.24:30
Richard Keogh has shot on goal from just outside the area which goes wide of the right-hand upright.23:41
Free kick awarded for a foul by Tom Kennedy on Will Hughes. Direct free kick taken by Paul Coutts.23:00
Will Hughes fouled by Tom Kennedy, the ref awards a free kick. Craig Bryson takes the free kick.22:16
Jeff Hendrick takes a shot. Save made by Luke Steele.21:34
Stephen Dawson produces a cross, Effort on goal by Jacob Mellis from inside the area goes harmlessly over the bar.20:01
Corner taken by Tom Kennedy, Jimmy McNulty takes a shot. Save by Adam Legzdins.15:46
Free kick awarded for a foul by Will Hughes on Stephen Dawson. Luke Steele restarts play with the free kick.15:10
Scott Golbourne challenges Conor Sammon unfairly and gives away a free kick. Paul Coutts takes the free kick.13:29
Close range effort by Chris Dagnall misses to the left of the goal.11:03
Gareth Roberts sends in a cross, Scott Golbourne manages to make a clearance.10:49
The ball is crossed by Paul Coutts, Tom Kennedy manages to make a clearance.10:23
The official flags Chris Dagnall offside. Adam Legzdins restarts play with the free kick.8:22
Centre by Gareth Roberts, Conor Sammon produces a left-footed shot from inside the six-yard box that clears the bar.8:07
The ball is crossed by John Brayford, Jimmy McNulty makes a clearance.7:25
Free kick awarded for a foul by Chris Dagnall on Richard Keogh. Richard Keogh takes the free kick.6:38
Outswinging corner taken from the left by-line by Will Hughes, Foul by Richard Keogh on Jimmy McNulty, free kick awarded. Luke Steele restarts play with the free kick.6:32
Will Hughes sends in a cross, blocked by Kelvin Etuhu.2:21
Stephen Dawson fouled by Will Hughes, the ref awards a free kick. Direct free kick taken by Tom Kennedy.0:00
The match gets underway.
Live data and text provided by our data suppliers