A brace from Ben Knight and a low drive from Dave Hoar secured the Yellamen's place in the last 32, where they will travel to Derby-based side Borrowash Victoria on January 19.
Ascot took the lead in the 11th minute when a quick free-kick by Sam Wadieh was headed down by Lee Boon into Knight, who fired it past the goalkeeper.
But the home side drew level a minute later when Vigan Rexhepi unleashed a shot from outside the box.
Knight's 38th-minute strike put the Yellamen ahead for the second time and it could have been 3-1 at the break had Rob Saunders' spot-kick not been saved.
However, Ascot got the two-goal cushion they wanted in the 53rd minute when Hoar ran on to a loose ball and blasted home.
Chris Grace then saved the second penalty of the match but a defensive slip in the 84th minute allowed the home side to make it 3-2.
It was a nervy ending for the Yellamen but they hung on for a famous victory.
Meanwhile, neighbours Binfield were knocked out after extra-time by Kent side Tunbridge Wells.
The scores remained goalless after 90 minutes but the Moles surrendered their extra-time lead to lose 2-1 at Hill Farm Lane.
James Suarez gave the home side the lead just a minute into extra time but substitute Richard Sinden equalised 10 minutes later.
A couple of ricochets in the box led to Bradley Large firing in Tunbridge's second goal that turned out to be the winner 19 minutes into extra time.
Chalfont Wasps were put to the sword by Bracknell Town in Hellenic Division One East as they stormed to a 7-0 victory.
Shane Cooper-Clarke led the way with a hat-trick, supported by two goals from substitute Jake White and strikes from Tom Barrett and Liam Alleyne.
The win moves Robins up to fourth in the league with five games in hand over their rivals.
In the same division, Chinnor and Finchampstead drew 1-1 with Ryan Chapman scoring for Chinnor and Harry Swabey replying for Finch.
Wokingham & Embrook were beaten by a second-minute goal from Jamie Mundy to go down 1-0 at Oxford City Nomads in the Hellenic Premier Division.
Sandhurst Town lost 5-2 to Ash United in the Combined Counties Premier Division.
They were due to travel to Bedfont Sports on Tuesday (7.45pm ko).
Eversley & California cruised into a 6-0 lead before eventually beating Spelthorne Sports 6-3 in Combined Counties Division One.
Paul Harkness netted a hat-trick with Bradley Cann chipping in with two goals and Neil Williams one.
* For all the Vase reaction see Thursday's News.
* Follow us on Twitter for all the latest news @BerkshireSport1