The visitors spurned a host of first-half chances before Brian Barry-Murphy and Andy Morrell struck in the last four minutes of the half.
Scott Davies pulled one back in the 83rd minute but Bury hung on to move into third place.
The hosts had started brightly with winger Mike Jones cutting in from the left and forcing Shots goalkeeper Mikhael Jaimez-Ruiz to parry, before Morrell headed over from Elliott Bennett's right-wing cross.
Shots responded well, with Bury keeper Mark Tyler making two fine saves to deny Davies from Kirk Hudson's throughball and Rob Elvins from the resulting corner.
Elvins headed over moments later after Hudson had got to the right byline, while Davies fired a 20-yard strike narrowly wide.
Hudson looked set to open the scoring after latching onto a long ball, forcing Tyler to charge out of goal, but Bennett got back to prevent a certain goal.
John Grant then got behind the Bury defence and Elvins wasted a great chance from Grant's lay-off, firing wide from close range.
Yet it was Bury that broke the deadlock, Barry-Murphy bundling the ball past Jaimez-Ruiz after playing a one-two with Andy Bishop.
Rhys Day then failed to deal with a low right-wing cross by Bishop and Morrell pounced to stab home his first goal in four months.
Morrell fired wide shortly after the restart while Bishop headed over before Shots boss Gary Waddock attempted to get back into the game with a double substitution.
Tyler did well to hold onto a low strike by Shots left-back Anthony Straker, while Jaimez-Ruiz did likewise from a 20-yard drive by Jones.
Grant turned a Hudson cross wide late on before Davies gave the Shots hope by firing home after Tyler had been penalised for picking up a back-pass by Stephen Dawson.