Mike Higdon fired his first goal of the season as Crewe clinched a last-minute win at the Alexandra Stadium.
The big striker has often been a target for the boo-boys this season, but he proved the difference between the sides after coming on as a late substitute.
When Rodney Jack lifted the ball over from the right Higdon directed a header into the bottom corner for a sweet winner for the Cheshire side, who had suffered a last-minute exit from the Johnstone's Paint Trophy at the hands of Rovers a week earlier.
It was Crewe's third consecutive win and may even reignite their faint hopes of a play-off bid.
And while Rovers had come out on top in the cup, Dario Gradi's side just about deserved to edge this contest. They showed a great competitive spirit against well organised opponents and carved out the better chances of an entertaining game.
Veteran keeper Neil Sullivan was making his debut on loan for the visitors and he was busy early on flicking Julien Baudet's header over, catching the Frenchman's volley from the resulting corner.
Ryan Lowe was always a threat for Crewe. He kept Sullivan busy with a couple of long-range efforts. And the Merseysider produced a dashing run at the restart which saw him cut into the area only to shoot straight at Sullivan.
Crewe's leading scorer Luke Varney headed against the foot of the post but the home side took a deserved lead when the corner offered midfielder Ben Rix the chance to loop a header into the top corner.
Rodney Jack went close with an angled drive across the face of goal.
But Rovers drew level when Billy Jones upended Lewis Guy inside the box and Paul Heffernan converted the spot-kick high into the top corner for the equaliser.
Sullivan came up with an agile save to keep out Lowe's free kick. The game appeared to be heading for a draw.
Rovers substitute James Coppinger produced stunning save out of Williams with a flashing volley, but it was Crewe who stole the three points with Higdon's late header.