Levi Amantchi scored in the final minute of added time as Maidstone won at Dartford in the FA Trophy.
The second-round tie appeared to be headed for penalties with time almost up.
But Amantchi had other ideas, grabbing his 17th goal of the season and leaving Dartford with barely any time to kick off.
Maidstone looked marginally the more composed on the ball during a frantic first half between two committed sides.
Both teams took the direct route to goal but there was nothing wrong with that, with some good old battles resulting.
The hosts went closest to breaking the deadlock when big defender Moussa Diarra’s header from a Luke Coulson free-kick came back off the post in the opening 10 minutes.
Darts debutant and former Stones loanee Ryan Sandford made two saves in quick succession for his new club soon after.
The first saw him get down well at his near post after Liam Sole ran on to George Fowler’s ball over the top and broke into the box, beating Baris Antintop before going for goal.
Sandford also proved equal to Lamar Reynolds’ strike from the edge of the area.
Amantchi went on to fire just wide after turning on Sole’s pass while, in added time, the big man ran half the length of the pitch down the left before coming inside and seeing his shot blocked.
Dartford got several balls in the box without anything else clear falling their way before the break.
Amantchi’s snapshot from a Perri Iandolo corner went over at the start of the second half.
The offside flag stopped a promising Dartford attack in its tracks at the other end before Iandolo had an effort blocked on the line following a jinking run in the box.
Big Darts frontman Alex Wall saw a ferocious free-kick clear the bar midway through the half and fired wide soon after before making way for Lewis Manor as part of a double change.
A good spell continued for the hosts, with Coulson’s strike blocked in the box and Luke Allen sending the follow-up over, while substitute Sam Oduadu missed the target after a bright run.
Dartford were looking the more likely winners as the clocked ticked down, with Maidstone struggling to get up the pitch.
The hosts had a big chance a minute from time when Tyrell Miller-Rodney fired over at the back post from Manor’s cross.
They rued the miss as Maidstone scored the winner with 20 seconds to go in added time.
Reynolds’ cross to the far post was played back across goal by substitute Harry Kyprianou and Amantchi fired home in front of the travelling fans.
Dartford: Sandford, Wynter, Miller-Rodney, Altintop, Coulson, Allen, Wall (Manor 68mins), Statham (Oduadu 68mins), Woods (Rooney 86mins), Nembhard, Diarra. Subs not used: Beeney, Sheringham, Box, Boulton.
Maidstone: Covolan, Fowler, Coleman De-Graft, Corne, Reynolds, Bone, Sole (Kyprianou 87mins), Amantchi, Gurung, Iandolo, Court (Rush 69mins). Subs not used: Petrasso, Wenham, Wanjau-Smith, Smith, Earle
Referee: George Laflin.