Crewe Alex edged closer to the drop in League One after a 3-0 defeat at promotion chasing Gillingham.
Dominic Samuel put the hosts ahead early on before an own goal from Jon Guthrie doubled the home side's lead just after the hour mark.
Josh Wright sealed victory in injury time.
Crewe remain 23rd in League One, seven points adrift of safety.
The Alex are back in action on Saturday when they entertain relegation rivals Blackpool.