Despite having so much of the game, the Dons looked toothless in attack and they have now gone four home games without scoring.
The nearest anyone came to finding the net in an awful first half was when Gillingham keeper Stuart Nelson could not hold George Baldock’s shot, but he gathered before Izale McLeod could get to the rebound.
The Gills began the second half brightly and Myles Weston’s shot was pushed out by David Martin after a superb run from the winger.
From the rebound, Cody McDonald cut the ball back and Fagan swept the ball in first-time into the far corner.
The Dons continued to dominate possession but the closest they came to an equaliser was when Dean Bowditch’s shot was headed away by Leon Legge with eight minutes left.