Derry had looked the more likely winner when Patrick McEleney fired home a spectacular free-kick after 75 minutes, but O'Neill's strike gave powered them into the fourth round in the end.
In a game played at a very high tempo, Derry looked the more potent of the two sides in the opening half, and were providing more of a threat in the final-third than The Seagulls. The home side were competing well, but were finding it hard to get enough supply up to O'Neill, as wingers Jake Kelly and John Mulroy were find it hard to get onto the ball. However, a strong Bray defence, anchored by 38-year-old defender Colm Tresson, were proving to be uncompromising and weren't affording the First Division outfit too many clear-cut openings.
Their resistance would eventually be broken on 29 minutes though, when Vincent Sweeney flicked on a James McClean cross from the right for the on-rushing
Cassidy, whose left-footed strike was finished coolly to the bottom right-hand corner of the net.
This represented something of a blow to Eddie Gormley's charges, but they were back on level terms 13 minutes later when winger Jake Kelly buried a penalty past Gerard Doherty in the Derry goal after Tresson had been fouled in the area by Thomas McBride.
This meant that the game was up in the air going into the second half, and Derry went extremely close to regaining the lead six minutes in when Patrick McEleney's effort was well saved by Bray 'keeper Brian Kane. Indeed, this stop would prove to be crucial as Bray went on to take a surprise lead just two minutes later when the elusive O'Neill ran onto a Dane Massey ball from deep and finished emphatically to the back of the Derry net.
Bray grew in confidence as a result of this goal, and looked like they might add to their total before the night's end. They would suffer a hammer blow on 63 minutes though when left-back Massey was given his marching orders on a second yellow for kicking the ball away. This provided Derry with a fresh impetus to attack, leaving Bray with a very nervy final quarter ahead of them.
And what a final quarter it was, as Derry drew level with 15 minutes remaining thanks to a thunderbolt free-kick from all of 30 yards by 17 year-old Patrick McEleney. This looked like being a catalyst for the visitors to push on, but O'Neill came up with the goods once again two minutes later, finishing crisply to the right of Doherty after a mazy run out of defence by Tresson.
As the tie entered into the final ten minutes, Derry pressed with all their might for an equaliser, but Bray managed to hold out for a most memorable victory. This will give Bray plenty of confidence going into next encounter against Galway United in the league next Monday at Terryland Park, while Derry will look to bounce back from this defeat when they face Mervue United at the same venue on Friday.
Bray Wanderers: Kane; S O'Connor, Tresson, Webster (D Doyle '36), Massey; Mulroy, Shields, Brennan, Kavanagh, Kelly; O'Neill (R Doyle '92).
Subs not used: A O'Connor, D Vickers, Byrne, Zambra, Lambert.
Derry City: Doherty; McCallion, Molloy, S McEleney, Friars (Harkin '80); P McEleney, McClean, Cassidy, Sweeney, Scoltock; McBride (Henry '71).
Subs not used: Ferry, Devlin, Coyle, Heraghty.
Referee: N. Doyle (Dublin).
Extratime Man of the Match: Shane O'Neill (Bray Wanderers).