The goals were spread around as the Glovers never got over the early sending-off of Aaron Brown. Stockport were dominant in the first half and had the tie all but wrapped up by the interval.
Home keeper Owain fon Williams saved Danny Schofield's third-minute penalty, before Gary Dicker put Stockport in front four minutes later when he headed home Tommy Rowe's corner.
Town defender Brown headed against the post, but after 15 minutes he pulled back Stockport striker Craig Davies and received a straight red card - and Michael Rose promptly curled home the resultant free-kick.
The third Stockport goal came three minutes before half-time, when Anthony Pilkington teed up Matty McNeil, who fired home with the outside of his boot. Pilkington netted the fourth himself three minutes after the restart when he fired home clinically from 15 yards.
Davies missed a couple of late chances for Stockport, but the victory had long since been sealed before sub James Vincent made it 5-0 in stoppage-time.