Substitute Matt McClure pounced with five minutes to go to hand a Wycombe a deserved 1-0 victory away to promotion-chasing Gillingham.
Gills goalkeeper Stuart Nelson looked like he was going to earn his side a point with a string of fine saves but moments after wasting a glorious chance McClure showed exquisite skill to turn past Matt Fish and fire home.
Martin Allen's side would have gone top with a win but despite the efforts of Deon Burton they struggled to create chances, instead it was Wycombe who offered the greater threat, Sam Wood's fizzed half-volley their best chance of the first half.
After the break the visitors dominated with Nelson denying Jo Kuffour from close range and keeping out Dean Morgan when clean through.
But after firing wide when in a great position two minutes earlier, McClure made no mistake to earn his side all three points.
The game ended in disappointing scenes as a Gillingham fan came on and clashed with Chairboys goalkeeper Jordan Archer in the final seconds.