Stockport won a real thriller at Edgeley Park to leave Crewe in dire trouble in the League One drop zone.
Joel Grant got off to a lively start for Crewe, and inside three minutes he had wriggled clear of the Stockport defence before shooting into the side-netting from a tight angle.
Soon after Gylfi Sigurdsson planted a header straight at home keeper Conrad Logan.
It was Stockport who fired themselves into a 13th minute lead though. Chris O'Grady fired in a low cross from the left, and there was youngster Jamie Vincent charging in and he tucked the ball home from ten yards.
The Railwaymen were quickly back on the offensive and within minutes Shaun Miller, Grant and Sigurdsson had all seen decent half-chances go begging.
Former Stockport striker Anthony Elding tried his luck from distance, but Logan saved his thumping half-volley comfortably.
Crewe leveled matters with a cracking strike midway through the first half. Elding was tripped by Michael Rose right on the edge of the Stockport box and up stepped Billy Jones to ram home the free-kick right into the top corner.
On 37 minutes Crewe's on-loan keeper John Ruddy made a flying save to keep out a bullet header from County defender Josh Thompson.
Stockport regained the lead four minutes after the restart. Tommy Rowe's initial shot was saved by Ruddy, only for O'Grady to pounce on the rebound as he fired in low from eight yards.
There was then an amazing three minute spell when three different players were denied by the woodwork.
Miller and Dennis Lawrence hit the bar for Crewe, while Stockport's Oli Johnson hit a shot against the post.
Johnson made it three one for the hosts on 65 minutes when his perfectly executed chip left Ruddy rooted to the spot.
Lawrence gave Crewe some hope with a second goal on 79 minutes, but just two minutes later Johnson bagged his second of the night for the hosts from close range.
Alex sub Scott McManus scored from 30 yards in stoppage time, but it was too late to gain a point.