Recalled strike pair Andy Bishop and Glynn Hurst grabbed two goals apiece as Bury got their League Two promotion campaign back on track.
Just one goal in five games had contributed to a wretched run of five straight home defeats, but the Shakers returned to winning ways with a comfortable victory at Gigg Lane.
Bishop gave the Shakers a ninth minute lead before Hurst scored his first goal of the season in the 40th minute.
They both struck inside five minutes around the hour-mark to seal the three points and avenge their FA Cup defeat by Gillingham two weeks ago.
Bury made a lively start and were rewarded with a ninth minute opener when Mike Jones' teasing left-wing cross cut open the Gillingham defence and Bishop pounced to stab the ball home from close range.
Gillingham replied with Adam Miller flashing a shot across goal and a timely challenge by Shakers skipper Paul Scott denied Mark Bentley a shot at goal.
Hurst then got to the byline for Bury and his cut-back was steered narrowly over by Bishop, while a Garry Richards header tested Bury keeper Wayne Brown from John Nutter's 29th minute corner.
Visiting keeper Simon Royce made a fine save to deny Hurst after a Bury corner was only partially cleared, before tipping over a Brian Barry-Murphy free-kick.
But Royce was caught flat-footed from the resulting corner as Hurst found space to head home Barry-Murphy's in-swinger from just a yard out.
Miller had a shot saved blocked shortly after the restart while Nutter was denied by Brown.
Royce then saved a 20-yard strike by Bury winger Elliott Bennett, but Bennett and Hurst combined for Bishop to score his second with a six-yard tap-in before Bishop returned the favour for Hurst to head home from a deep left-wing cross.
Gillingham missed out on a consolation when Miller saw his 73rd minute spot-kick saved by Brown, who was booked for bringing down substitute Mark McCammon.