Wigan Athletic came from two goals behind to beat high-flying Gillingham 3-2 in Thursday evening's League One match.
Strikes from Dominic Samuel and Rory Donnelly left the visitors with a 2-0 lead early in the second period, but Will Grigg and Max Power struck within four minutes of each other to level the scores, before Craig Morgan won it for the hosts in the final moments.
Gillingham have missed the chance to move top of the table above Burton Albion, while Wigan remain fifth and now seven points inside of the playoff positions.
It was the visitors that came closest to opening the scoring at the DW Stadium, Bradley Dack hitting the woodwork from a free kick in the 14th minute. Gillingham were level just 11 minutes later, however, when Samuel produced a cool finish from inside the box.
A close-range header from Donnelly made it 2-0 Gillingham early in the second half, but Michael Jacobs set up Grigg for 2-1 in the 64th minute, before Power's deflected effort left the two teams on terms with little over 20 minutes remaining.
Donervon Daniels's effort just fizzed wide of the post as Wigan went searching for a winner and the turnaround was complete in the sixth minute of additional time when Morgan rose inside the box to head past Stuart Nelson from close range.