Jack South struck in the 10th minute to put the hosts in front but St Mary’s levelled five minutes later with a decent finish.
Ten minutes before half-time Callum Gravestock restored Riding’s lead from a corner, and in the 50th minute Josh Foley flicked the ball home from six yards and the hosts looked to be in firm control of the game.
But on the hour mark a strong challenge by Riding’s Liam Buglass sparked a 20-man brawl, which ended in two Riding players, Buglass and Aiden McCallion, both being sent off and one of the visitors also receiving his marching orders for their parts in the incident.
Ten minutes later the away team had the ideal chance to level the scores from the penalty spot, but stand-in keeper Josh Young saved the spot-kick and thanks to some strong defending the nine-man hosts held onto their lead to progress to the third round against the 10-man College side.
RETRO SPOTLIGHT: 15 nostalgic Scarborough photos from the Scarborough News sports archives
Ebberston battle back to sink hosts Filey in SBL Premier Division thriller
Scarborough Athletic slip to 2-0 defeat at Brackley Town in National League North opener
Former Harrogate Town and Bradford City goalkeeper Joe Cracknell returns to Scarborough Athletic
Racers ready to return to action at Steve Henshaw Gold Cup in September
West Riding boss James Prethero said: “All the lads played really well so they all deserve to share the man-of-the-match award.”
Newlands Park had a much easier time in their game at Layfield Arms (Yarm), strolling to a 7-1 win despite not being on top form.
Adam Stride opened the scoring for Park, and although the hosts levelled, further goals from Kyle May and Jack Hakings put them 3-1 in front at the interval.
Jordan Mintoft then made it 4-1 early in the second half, and a May penalty sealed the win, with Matthew Shone’s effort and an own goal completing the scoring.
Left-sided midfielder Aidan Thomas and left-back Sam Cooper were the star players for Newlands.
Trafalgar returned to the top of the Scarborough News Sunday League division one table thanks to a hard-earned 5-1 home win against Klosters.
Klosters were on top for the opening 25 minutes, spurning a couple of clear opportunities to take the lead and seeing two penalty appeals waved away by the match official.
The home side began to take control of the game as the half wore on and visiting keeper Mark Vasey made a string of fine saves to keep the game goalless.
Trafalgar eventually took the lead just two minutes before half-time through Billy Logan’s header.
Klosters were level soon after the re-start when Georgie Rose smashed home after Simon Rigg’s clever pass set him free.
Both sides created chances with the game hanging in the balance but it was Traf who grabbed the all-important next goal after 65 minutes, player-boss Liam Salt heading in shortly after coming on as a sub.
Klosters couldn’t find a second leveller and as they began to tire the hosts ran in three goals in the final 10 minutes, hot-shot Logan scoring all of them to take his personal tally to four.
Klosters boss Rhys Howell said: “It’s hard to take losing a game 5-1 when I think we actually played really well against a very good side.
“It is however a real shame when such a competitive, closely-fought fixture is spoiled by the referee.”
Salt singled out Logan as their star man for his lethal finishing, and admitted that the scoreline flattered his team in a keenly-contested encounter.
Fylingdales battle back from 2-0 down at Itis Itis to claim a 3-2 victory.
Paul Oldroyd fired the hosts in front with a brace of goals before half-time, but the villagers secured all three points with three well-taken efforts after the interval.
Dave Welham pulled a goal back for Fylingdales early in the second half with a fine finish from the edge of the area into the bottom corner from the edge of the area.
Sam Richardson scored the leveller with a fierce shot, also from the dge of the area, after some fine approach play.
Richardson then netted the winner with a low, drilled effort into the far bottom corner which left the home keeper rooted to the spot.
Si Forde then hit the crossbar with a powerful header for the visitors and Richardson spurned the chance to complete his hat-trick, draggin his shot wide from 10 yards.
Jamie Williams, at centre-back, and left-back Carl Marton shone for the hosts.
Scarborough Sports Barrowcliff struck twice in the final five minutes to snatch a 4-3 win at Cayton Corinthians in a cracking second division clash.
Josh Bowmaker opened the scoring for the visitors and this soon became 2-0 when Sean Naylor fired in from close range.
With the wind behind them, the villagers roared back into action during the second half, a Shaun Rennison strike and a John Best penalty levelling the scores.
The hosts then went ahead with a cracking 20-yard strike from young sub Curtis Foreman, his shot fizzing into the top corner of the net.
Naylor equalised for the away team with an 85th-minute strike and the same player was then fouled in the area and slotted in the spot-kick to earn the points for the Barrowcliff side.
Dean Johnson was named as man of the match for the victors, having excelled at right-winger and then also at right-back later in the game.
Leaders Trafalgar Reserves cruised to a 5-0 win against Fylingdales Reserves, in-form striker Mikey Barker smashing in a hat-trick for the hosts.
Barker gave Traf the ideal start, applying a fierce finish to a great move which ended in young Louis Palmer heading the ball back for the striker to pounce.
Traf made it 2-0 with Barker’s second and Damien Robinson gave the hosts a three-goal cushion before Danny Glendinning’s penalty put Traf 4-0 ahead at the break.
Barker completed his hat-trick with his only goal of the second half, also from the penalty spot.
Defenders Dave Bates and Kurtis Henderson were the star men for Traf.
Roscoes Bar moved up to fourth place with a 2-0 home win against Heslerton.
The villagers started brightly and Bar keeper George Allen was forced to make a great save onto the post to keep the scores level.
In the final 20 minutes of the first half, the home side started to get a foothold and Martin Hadrick scored from a corner.
Heslerton came out flying in the second half and had an early chance but George Allen saved well again, but the hosts soon took control and created a number of chances but failed to finish them off. Tom Allen scored with a minute to go after a stray backpass, to seal the win for the hosts.
Bar boss Lee Paterson said: “We defended really well as a team. George Allen just tipped Scott Newland to man of the match with his great saves.”
Heslerton’s man of the match was Tony Cass.
Ayton debutant Daz Arnott sparked a 5-2 win for the visitors at Scarborough Spa.
Player-manager Mark Plumpton and Niall Prentice linked up well to set up left-back Jonny Atkinson to fire the villagers in front in the 12th minute.
Arnott then set up Brad Parkin to head in his first-ever goal for Ayton to double their lead, and another Arnott assist allowed Tyson Stubbings the chance to make it 3-0.
Atkinson pounced to slot home his second before half-time when Arnott’s shot was only parried by the Spa keeper.
Rich Tolliday pulled a goal back for the hosts after the interval, but Arnott’s third assist of the game released Kieran Friett to see Ayton go 5-1 ahead.
Tolliday scored again 10 minutes from time but it was too late to save the hosts from defeat.
Arnott and Atkinson shared the man of the match award for the victors.
Hull University earned a 2-0 win at The Alma.
George Thompson opened the scoring for the students in the first half with a well-taken free-kick, and after the interval Saygun Kerem sealed the win.
Thompson was named as the Uni man of the match while Shaun Evans shone in defence for the visitors.
Alma boss Philip Clothier said: “It was a close-fought game but they edged it. Keith Savage was excellent in goal again and got our man of the match award.”