Liam Craig put Town ahead after just eight minutes after good work by Darryl Knights and Billy Clarke, before the home sided levelled things in the last minute of extra time through Francino Francis who scored from close range.
The game then extra time, and after a handball in the Stoke penalty area in the first half, Liam Craig stepped up and converted the penalty to send Town into the Fifth round and a tie against Aston Villa at Portman Road.