Gillingham suffered a 2-1 defeat at the hands of relegation threatened Bury on Saturday afternoon.
Neil Danns claimed a 12th-minute opener before Harry Bunn doubled Bury’s lead in the 25th minute.
Connor Ogilvie pulled one back for mid-table Gillingham after 69 minutes but the Shakers hung on to move within eight points of safety.
Bury impressed in the first half, with Bunn hitting a long-range effort straight at Tomas Holy before Zeli Ismail fired wide.
Ismail then found Danns on the edge of the box and his low shot crept under Holy.
The hosts remained on top, with Bunn dragging a shot wide before sweeping in Ismail’s cut-back.
Lee Martin replied by firing wide, but Bury forward George Miller forced a save from Holy.
Holy denied Miller again just after the break, with Bunn’s follow-up blocked on the line.
And the Gills rallied with substitute Scott Wagstaff blazing over before crossing for left-back Ogilvie to head home.
Wagstaff then curled a shot wide in stoppage time and goalkeeper Holy had a shot saved after going up for a corner, but the Gills could not avoid just their second defeat in 14 league games.
The defeat leaves The Gills 11th in League One, seven points outside the play-off places, but crucially ten points clear of the relegation zone.
Steve Lovell’s side will now prepare for the visit of Rotherham United to Priestfield on Saturday afternoon, weather permitting.
Bury line up: Ripley, Leigh, Edwards, Ismail, Miller (Hanson 88), O’Shea (Tutte 84), Cameron, Ince, Danns, Bunn (Thompson 91), Clarke.
Subs not used: Murphy, Maguire, Dawson, Dai.
Goals: Danns (12), Bunn (25).
Gillingham line up: Holy, O’Neill, Ogilvie, Nugent, Ehmer, Zakuani (Wagstaff H/T), Byrne, Hessenthaler, Martin, Parker, Eaves (Wilkinson 42).
Subs not used: Hadler, Garmston, List, Nasseri, Moussa.
Goal: Ogilvie (69).
Referee: Mr Darren Drysdale
Attendance: 3,004 (184 away)