Dominic Samuel fired home from close range to open the scoring before Crewe's best chance came when Zoumana Bakayogo's 25-yard volley hit the post.
Gillingham's second came when Samuel's 61st-minute volley hit the bar and rebounded in off defender Jon Guthrie.
Josh Wright added an injury-time third, slotting his shot in off the post.
Gillingham stay third, three points off from an automatic promotion spot.
Crewe remain second from bottom, seven points shy of safety, with 10 games left, starting with next Saturday's key home game against 21st-placed Blackpool.
Crewe boss Steve Davis told BBC Radio Stoke:
"We didn't offer much as an attacking threat in the first half. Only Zoumana Bakayogo offered something in the final third. He was our outstanding player,
"He was a threat with his pace and willingness to get forward and put crosses in for us and his volley was an excellent effort.
"We went for it and had a go in the second half. We gambled and that is always going to leave spaces for the opposition. We had a great chance to level it up when Marcus Haber has put Tom Hitchcock in but he snatched at it. It was a type of finish from someone who is a bit out of form and it was a key moment because, not long after, they get their second goal.
"It was a mistake between our left back and centre-back, Samuel has got free in the box and hit the underside of the bar and it has hit Jon and gone in. That about sums it up for us."
Gillingham won for the first time in five games to restart their automatic promotion push, as they beat League One strugglers Crewe Alexandra.