A 96th-minute bullet header from captain Craig Morgan secured an incredible come-from-behind victory for Wigan Athletic in a five-goal thriller against promotion rivals Gillingham.
The visitors, who had won the corresponding fixture back in August 2-0, again took a two-goal advantage by the hour mark and looked good value to take the spoils.
After Bradley Dack had hit the post with a brilliant free-kick, Dominic Samuel did put Gillingham ahead in the first half with a tidy finish.
And it looked bleak for Latics when Rory Donnelly made it two shortly after the restart with a clinical header.
However, a double substitution from Gary Caldwell turned the game on its head just before the hour mark, with the introduction of Chris McCann and Jordy Hiwula breathing new life into Latics.
Will Grigg gave the home side heart with a good finish from close range after great work from Michael Jacobs.
And Max Power levelled the scores with a long-range strike that somehow slipped through the fingers of Gills goalkeeper Stuart Nelson.
There was only one team going to win it in the final quarter, and the winning goal finally arrived right at the death.
Power’s corner was right into the mixer, and Morgan rose like a salmon to plant his header into the roof of the net.
The result sees Latics move to within six points of the second-placed Gills, with a game in hand, and piles the pressure on their other promotion rivals ahead of the weekend action.
Latics came into the game having picked up an impressive seven points from a possible nine over the festive period.
However, they were on the back foot from the off as the visitors controlled the early exchanges.
With only 14 minutes on the clock, Gillingham won a free-kick 25 yards from goal.
Dack lined it up with menace, and his delivery flew over the wall and past Jussi Jaaskelainen before smacking the inside of the post.
The ball found its way to Donnelly but, from a tight angle, his finish was way off target.
At the other end, a David Perkins cross from the right found its way to Jason Pearce inside the six-yard box.
However, with only the goalkeeper to beat, the big centre-half could only flick his attempt straight at a grateful Nelson.
Latics were to pay for that miss when they fell behind shortly after the midway point in the first half.
Dack it was who played a lovely ball over the top to find the breaking Samuel.
The striker had enough pace to remain in the clear, and his cool finish over Jaaskelainen gave the Gills the lead.
Credit Latics for the way they responded, though, and they twice came close to an equaliser within three minutes.
First, Jacobs saw a shot from 20 yards tipped round the post by a diving Nelson.
Then, from the resulting corner, Andy Kellett succeeding in heading wide from point-blank range when it seemed easier to score.
Grigg thought he was through on the halfway mark only to be pulled back by an offside flag.
A superb dummy by the Latics striker then threatened to allow Donervon Daniels’ cross to reach Jacobs, who just couldn’t get there.
And the cross back in from Reece James was hacked away as Gillingham clung on to their advantage.
Daniels himself had the next chance, when he cut inside off the right only to drag his shot well wide of the target, before Pearce headed wide from another fine Power cross.
The visitors were content to sit back and attack on the counter, and they almost doubled their lead within a minute of the restart.
A corner from Dack found Samuel at the near post, but his flick flew wide of the near post.
Dack then had a golden opportunity himself when he dribbled his way through the heart of the Latics defence to leave himself one-on-one with Jaaskelainen.
However, with both sides of the goal to aim at, the Gills’ star man inexplicably attempted to round the goalkeeper - and succeeded only in running the ball out of play.
It was an amazing miss, but unfortunately only spurred the visitors on to scoring the second goal they’d long been threatening.
Substitute Doug Loft crossed from the right, and Donnelly soared over Daniels to plant a clinical header past a helpless Jaaskelainen on 53 minutes.
That was the cue for Latics to make a double change, with McCann and Hiwula taking over from James and Kellett.
Within 12 minutes, it was all square.
A McCann cross from the left was superbly nodded back into the danger area by Jacobs for Grigg to lash home.
Then, midway through the second period, a long-range strike from Power - powerfully hit but straight at the goalkeeper - somehow found its way through Nelson’s fingers and over the line.
Roared on by the home fans, Latics threw everything at trying to force a late winning goal.
Daniels fired just past the post from the edge of the area, with Hiwula doing likewise from a similar position.
But Latics were given a huge lift when six minutes of added time were announced.
With Gillingham trying to hold on, and making subs to run down the clock, all the ascendancy was with the home side.
And goal number three finally arrived in the sixth and final added minute, when Power’s pinpoint corner was headed into the roof of the net by Morgan - to raise the roof off the DW Stadium.
Latics: Jaaskelainen; Daniels, Barnett, Morgan, Pearce, James; Power, Perkins, Kellett; Jacobs; Grigg.
Subs: Nicholls, Love, McCann (for James, 55), Cowie, Vuckic, Hiwula (for Kellett, 55), Davies (for Jacobs, 90).
Gillingham: Nelson; Jackson, Egan, Ehmer, Garmston; Morris, Hessenthaler, Wright, Donnelly; Dack, Samuel.
Subs: Morris, Loft (for Morris, 46), Williamson, McGlashan (for White, 86), Osadebe (for Hessenthaler, 86), Norris, List.
Referee: S Duncan