Matty James headed the visitors in front early in the second half, but Tom Ince replied before Nugent pounced on a defensive error to give Derby a first win in seven games.
Derby had switched to a 4-2-3-1 formation to try and get back on track, with Matej Vydra making his first start since early January, and the Czech forward had an early chance to make an impact when he got behind Barnsley on the left, but could not quite pull the ball back.
Barnsley had a better opening in the 11th minute when Tom Bradshaw ran into the area on the right. His scuffed shot was taken on by Adam Armstrong, whose low drive went just past the far post.
Armstrong was in again, this time on the left, four minutes later and forced Scott Carson to turn his shot behind for a corner.
Barnsley were breaking dangerously and won a free-kick just outside the area when Adam Hammil was tripped.
Hamill’s attempt struck the top of the wall, but Derby’s new formation was looking far from convincing.
However, at the other end a poor clearance by Andy Yiadom allowed Johnny Russell to whip in a cross which just evaded Vydra at the back post.
Yiadom was booked for foul on Julie de Sart and then lost out to Russell in the 31st minute, but the Scot’s shot hit Adam Davies and was cleared before De Sart’s 25 yard drive forced him into a more routine save.
Ince fired over as Derby finally found some rhythm and the first half ended with the home side putting pressure on Barnsley, who were giving the ball away cheaply.
Derby made a change at half-time, with De Sart replaced by Jacob Butterfield, but the home side went behind in the 52nd minute when a long throw by Marc Roberts was headed in by James.
The response, though, was immediate.
Derby equalised two minutes later when Cyrus Christie crossed from the right and the ball fell to Ince who slammed a shot past Davies from 10 yards.
Ince had a free-kick touched over in the 58th minute, but Barnsley broke dangerously from the corner and James had a shot charged down.
Derby went close when Davies pushed an Ince shot on to a post in the 70th minute and the keeper made another vital save two minutes later when he turned over a Russell drive.
And the hosts went ahead in the 76th minute when a poor clearance fell to Nugent who drilled in a low shot from 15 yards.
Only a goal-line block by Alex Mowatt denied Christie a third three minutes later.
Barnsley had a chance in stoppage time, but Ryan Kent’s shot was straight at Carson and Derby held on for a long overdue victory.