Derby County 2-1 Barnsley
Derby scored twice in the first half to leave Barnsley four points adrift of safety in the Championship.
Jeff Hendrick netted the opener for the home side, letting fly from long-range after Craig Bryson's pass.
They grabbed their second just before the interval through Johnny Russell, whose looping shot evaded Luke Steele.
Barnsley pulled a goal back with 10 minutes remaining when Nick Proschwitz scored from inside the box, before Steele saved Russell's spot-kick.
The hosts started the match on the front foot and Hendrick curled a shot just over the bar in the opening 10 minutes, but former Rams player Tomasz Cywka forced Lee Grant into a save in the 17th minute in a rare Barnsley attack.
Hendrick, though, gave Steve McClaren's men the lead on 34 minutes, as goalkeeper Steele thought a 25-yard shot from Hendrick was going wide only for the ball to creep inside his right post.
Steele was blameless for the second goal in the 42nd minute when Russell's 22-yard strike took a deflection off team-mate Craig Bryson and looped inside the net.
The visitors started the second half encouragingly. Tom Kennedy's 20-yard free-kick was touched over the crossbar by goalkeeper Grant.
Bryson curled a 20-yard free-kick narrowly over for Derby, before Craig Forsyth's header was cleared off the line.
But Barnsley were back in it with 10 minutes to go when Lewin Nyatanga played the ball in for Proschwitz to slide home.
Steele kept his side in it two minutes later when he saved a Russell penalty after Conor Sammon had been tripped by Jean Yves Mvoto but they remain in trouble with just two games remaining.
Derby head coach Steve McClaren: "The last 10 minutes were very unnecessary and shows we still have a bit to do with this team.
"When we control a game like that, play the football we do and create the chances we do, we need to be more ruthless and it nearly cost us in the end. So what could have been a harsh lesson was in the end just a lesson that we need to carry forward and take into the play-offs.
"To create that many chances and only score two was unbelievable. I couldn't fault the performance and the attitude, the only thing I could fault was we didn't get the third goal.
"When you are on top and you've got them down, you have to make sure you finish them. But we didn't, we let them back up and gave them a chance, and against different opponents that might have cost us."
Barnsley manager Danny Wilson: "It doesn't really change anything, we've always needed to win games and the next two games we've got to win.
"It's as simple as that. Everyone will be writing us off, we are down in everybody's eyes and that's understandable. But we have six valuable points to play for and who knows what twist of fate is waiting on the last day of the season?
"We have to genuinely believe we can be the recipient of a good result on that particular weekend and stay up, but it will need two wins. You know from experience that on the last day of the season peculiar things happen.
"We've had some very good displays in recent weeks and that gives me belief, it really does. And we have some very good characters in the dressing room who will give it everything."
- 34ThorneSubstituted forEustaceat 63'minutes
- 9MartinSubstituted forSammonat 79'minutes
- 10WardSubstituted forDawkinsat 66'minutes
- 8DawsonBooked at 58mins
- 42McCourtSubstituted forMellisat 45'minutes
- 14LawrenceBooked at 60minsSubstituted forProschwitzat 72'minutes
- 19CywkaSubstituted forNoble-Lazarusat 68'minutes
- Graham Scott
- Shots on Target