Crewe booked their place in the Johnstone's Paint Trophy final despite a 2-0 defeat to Coventry at the Ricoh Arena on Tuesday.
Crewe led 3-0 going into the second leg of the Northern Section final and looked to be cruising through until a Mark Ellis own goal and Leon Clarke strike in injury-time set up a tense finish.
The Sky Blues could have reduced the arrears as early as the fifth minute when Clarke connected with Carl Baker's cross but the striker's header went inches wide.
Former Alex favourite James Bailey drilled wide from the edge of the box while Crewe goalkeeper Steve Phillips had to fist away a swerving effort from Baker.
Gary McSheffrey flashed a dangerous ball across the face of goal but City striker Stephen Elliott could not make the vital connection to steer it into the net.
At the other end, Cyrus Christie made a last-ditch block to deny Gregor Robertson while Luke Murphy dragged a free-kick wide of the upright.
After the break, Ellis headed Murphy's free-kick over the crossbar before Bradden Inman's surging run set up Ajay Leitch-Smith but his shot was kept out by Joe Murphy.
Baker was guilty of blowing a golden chance for the visitors when he scuffed McSheffrey's centre with the goal at his mercy, while Jordan Clarke went much closer with a fierce 30-yard effort that whistled wide.
Clarke summed up City's night in front of goal when he shot straight at Phillips after good work from Baker and Bailey.
But, as the game entered injury-time, Ellis looped a long punt over his own goalkeeper before Clarke headed in Baker's cross to set nerves jangling, but Crewe held on.