Gillingham claimed their seventh victory in eight home games as Shaun Williams hit a stoppage-time winner in their 1-0 defeat of promotion-chasing Carlisle.
The hosts should have gone ahead approaching the hour but Oli Hawkins miscued his header before Tim Dieng met Tom Nichols’ cutback but fired tamely at former Gills goalkeeper Tomas Holy.
Carlisle took 80 minutes to record a shot on target, substitute Kristian Dennis leaving Glenn Morris untroubled.
Max Ehmer looped a header from Williams’ corner into Holy’s hands and Dieng’s shot from distance was deflected as the Gills looked the more likely to score a late winner.
Holy’s mistake on his return to Priestfield gifted the hosts their late victory as the Czech goalkeeper parried Dom Jefferies’ shot straight to the unmarked Williams, who fired home from close range.
Defeat saw Carlisle drop to fourth, albeit just a point behind Stevenage, who lost at home to Salford.