Crewe's chances of securing a play-off spot took a blow as Cheltenham secured a 3-2 victory at Gresty Road with two late goals from Jordan Thomas and Liam Dulson.
George Miller scored his first goal in 10 games to give the Robins a lead in the 22nd minute. Ryan Haynes missed an opportunity to double the visitors' lead when he hit the bar with his penalty 10 minutes later. Crewe equalized just before half-time with Kane Hemmings converting a penalty.
However, Lee Bell's team showed vulnerability at the back as Cheltenham ended their four-match losing streak with late goals from Thomas and Dulson, while Crewe's Calum Agius scored a consolation goal with virtually the last kick of the game.
Miller opened the scoring with a header from close range following a cross from Arkell Jude-Boyd, who beat his marker convincingly.
Crewe faced more trouble when Lewis Billington was penalized for handling a cross, but Haynes failed to convert the penalty, hitting the bar.
A foul on Hemmings led to Crewe's equalizer, with the striker converting the penalty past Joe Day.
Poor defending led to Crewe falling behind again in the 78th minute as Valintino Adedokun set up Thomas for a close-range finish. Dulson then sealed the win with a long-range effort in the 86th minute, before Agius scored for Crewe just before the final whistle.