Gary Johnson's Glovers now host Wycombe in the Southern Area quarter-finals in the week commencing December 3.
Keanu Marsh-Brown smashed in the fifth Yeovil penalty after keeper Marek Stech had saved Torquay's third kick taken by Thomas Cruise.
United opened the scoring following a sweeping move which resulted in Billy Bodin crossing from the left for recalled striker Ryan Jarvis to convert from close range after 24 minutes.
Yeovil replied when striker James Hayter volleyed in on the spin following a 37th-minute goalmouth scramble. The visitors should have taken the lead three minutes later when Reuben Reid fired across the face of the Torquay goal and Sam Foley also went close.
That stung Torquay into a response and another move - involving skipper Lee Mansell and winger Danny Stevens - enabled Jarvis to fire home in the 57th minute. Yeovil forced a shoot-out when Hayter doubled his tally in stoppage time, roofing in Marsh-Brown's cross from the right.