Derby got back to winning ways as they came from behind to see off Wigan 2-1 in the Sky Bet Championship on Tuesday night.
Wigan hadn't won away since August, but Gavin Massey's first-half goal at Pride Park briefly made it look like that run would come to an end.
Frank Lampard's side, who had lost three in a row before facing the Latics, rallied in the second half as substitute Mason Bennett scored a wondergoal and Scott Malone struck.
It lifts Derby back level on points with Bristol City in sixth, with only an inferior goal difference keeping them out of the play-off spots. Wigan, meanwhile, stay 19th, three points clear of the drop zone.
Derby dominated the ball in the first half but did little with it, and a careless loss of possession saw Wigan score their opener after 25 minutes.
Michael Jacobs raced forward on the counter-attack and fed the ball into the path of Massey. It looked like he had been sent too far wide initially but some dreadful goalkeeping from Scott Carson allowed the striker the easy opportunity to slot the ball through his legs and into the back of the net.
Derby found their way back into the game just after the hour-mark pretty much out of nowhere. Malone hadn't had the best of games but his ball in from the left was finished sublimely by substitute Bennett as he twisted his body round to shoot past Jamie Jones.
And Malone would go on to find the winner himself, as he popped up in the box on 78 minutes to turn Bogle's attempted shot into the back of the net from close range.
Man of the match - Scott Malone
In truth it wasn't a vintage performance from Malone in the first hour. But Derby needed someone to step up to get them out of a rut and he produced two vital moments in the match, teeing up Bennett for the equaliser and showing predatory instincts for the winner.
The managers
Frank Lampard: "It's an important victory because we had lost three and when things are going against you it takes absolute character and fight and belief to get out of it and that's as proud as I've been this season," Lampard said.
"Mason's strike was incredible and I was saying the last time I felt like that at a game was the Champions League final when Gareth Bale scored the overhead kick. I think that goal was similar in terms of the adjustment at the last second and to score from an impossible angle is a special goal for Mason and he should savour it.
"Some cynical people will say he didn't mean it but I think he certainly did, the intention was there and his adjustment in the millisecond made that goal possible."
Paul Cook: "We are disappointed. We feel at the point of the equaliser we were at our most comfortable in the game, we had managed to weather everything.
"I haven't seen the goal back but it's either an absolutely fantastic goal or a little bit lucky, but that's football and you sensed the atmosphere in the stadium change immediately. They became buoyant and on the front foot and we couldn't see it out, it's so disappointing.
"We go home with nothing so there's nothing to be positive about for me. To maintain our status in the league we are going to have to win some games and that's the challenge for us all."
What's next?
Both sides are back in Sky Bet Championship action on Saturday at 3pm. Derby host Sheffield Wednesday and Wigan head to Reading.