A brilliant Lewis McGugan free-kick kept Nottingham Forest's hopes of automatic promotion alive. McGugan's superb curling shot from 21 yards five minutes from full time kept Forest four points off second place.
Gills keeper Romain Larrieu frustrated Forest until then with fine saves to deny Junior Agogo and Jack Lester.
Gillingham were content for the most part to defend in depth but midfielder Mark Bentley fired an early effort into the side-netting.
Nottm Forest: Smith, Curtis, Chambers, Breckin, Wright, Perch, McGugan, Gary Holt, Commons (Moloney 90), Lester (Tyson 76), Agogo (Grant Holt 83).
Subs Not Used: Pedersen, Dobie.
Booked: Perch, Commons.
Goals: McGugan 85.
Gillingham: Larrieu, Clohessy, Sancho, Johnson, Jackman, Bentley, Flynn (Easton 66), Crofts, Spiller, Mulligan, McDonald.
Subs Not Used: Ndumbu-Nsungu, Cox, Chorley, Collin.
Att: 17,950
Ref: M Haywood (West Yorkshire).