A stoppage-time header from Chris Martin kept Derby in the hunt for automatic promotion as the Rams came from 2-0 down to beat Yeovil.
John Lundstram's low 20-yard shot and Ishmael Miller's speculative effort put the visitors in control at the break.
Steve McClaren's side responded with a header from Patrick Bamford but they still trailed with three minutes left.
Craig Bryson slotted home the leveller and the points were secured when Martin headed in Bryson's free-kick.
Derby had only won once since their seven-game winning streak came to an end on Boxing Day but this win keeps them four points behind second-placed QPR.
Yeovil stay bottom after a fifth defeat in their last six games, but Gary Johnson's side came close to an upset.
Derby had hit the post through a deflected shot from Simon Dawkins when the Glovers took the lead when on-loan Everton youngster Lundstram surged forward and drove a low right-footed shot into the bottom corner from 20 yards.
The Rams had strong claims for a penalty waved aside when Martin appeared to be shoved and Yeovil scored again two minutes later when Lundstram found former Manchester City man Miller who brushed off Richard Keogh to fire a cross-shot inside the far post.
Bamford stooped to head in Dawkins's cross after the restart and then hit the post as Derby looked like being frustrated.
The hosts managed 36 shots on goal and finally levelled when Will Hughes teed up Bryson, and Bryson then provided the winner with a cross which Martin flicked home.
Derby head coach Steve McClaren:
"With all the successful teams, it's all about the last 10 minutes, you wear teams down and that's basically what we did tonight. We just ground them down and kept going and going.
"We got shots in and put balls into the box and kept creating chances and eventually we got our reward. It was the 85th minute when we got the winner against Brighton and the 84th minute when we equalised at Blackburn on Saturday.
"Tonight it was the 89th minute and injury time when we turned the game around so that's the pleasing thing for me that the team keep going and finish strongly."
Yeovil boss Gary Johnson:
"The least I say the better because I am as upset as everybody else. We played to a plan and got a couple of decent goals but you know they are going to come at you.
"They went 4-2-4 and unfortunately we didn't have enough nous to deal with it at that time. We kept giving the ball away and giving them runs of attacks. We kept giving it away and you can't do that against good teams.
"We came so close but it was a stupid free-kick to give away and it's a shame because there were a few out there who put a lot into their game."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.