Brad Inman scored an 88th-minute winner for Crewe to extend Bury's winless streak to five matches.
The out-of-form Shakers began the strongest and almost had an early lead when Troy Hewitt's effort from Matt Doherty's cross squeezed over the bar.
The visitors continued to press, David Worrall and Hewitt forcing Alan Martin into fine saves.
But the hosts won it late on when Inman, on loan from Newcastle United, poked home to secure the three points.
VIEW FROM THE DRESSING ROOM
Bury manager Kevin Blackwell told BBC Radio Manchester:
"We thoroughly outplayed them from minute one to minute 90. To get mugged at the end frustrates me.
"The players were outstanding but we've got to be more ruthless. We've had four of five great chances that should be finished.
"We've outplayed them and out-thought them. It's left me sick."