Glenn Walker put Saints ahead midway through the first half and Saints dug deep to keep out the League One outfit thanks to a combination of brilliant goalkeeping, superb defending and poor Gillingham finishing.
It will go down as the biggest win in Brackley Town’s history and it was fully deserved as Jon Brady’s side produced a performance full of desire and remarkable resistance to somehow keep a clean sheet and record a memorable victory. They now go onto to face Macclesfield away in the second round.
The hero of the day was 20-year-old goalkeeper Alastair Worby, who had previously only played two competitive games for Brackley, as the youngster pulled off a string of superb saves to keep Saints in front. The full time whistle sparked scenes of jubilation with Brackley fans pouring onto the pitch to celebrate a stunning victory.
Jon Brady had kept faith with Worby after his impressive performance against Leek, while Eddie Odhiambo came back into the team for the injured Izak Reid.
Just as they did last week in Kent, Brackley came flying out of the traps and pressed the visitors high up the pitch in the opening exchanges, not allowing them any time on the ball with Gary Mulligan having an early sight of goal but the former Gills man fluffed his lines.
Gillingham responded with their own period of pressure, however, and they had the first shot on target when Charlie Lee’s 25-yard strike was tipped over by Worby.
The League One outfit remained on top and took control of possession against a Brackley side showing signs of TV nerves, with another long-range effort flying over Worby’s goal.
The pressure on the home goal mounted and a rejuvenated Gillingham continued to press with Bayo Akinfenwa’s header well-saved by Worby.
Then came the decisive and historic moment as, against the run of play, Brackley took a shock lead midway through the half. Walker was the scorer as he collected the ball inside the Gillingham half, drove at the defence and rifled in a shot that took a deflection and evaded Stuart Nelson in the visiting goal.
It sent the 1,700-strong crowd inside St James Park into raptures as Brackley were once again on course for a huge upset, and the goal breathed confidence into the home side and they began to enjoy more of the ball.
The excellent Walker continued to pose problems for the League One side, but Brackley were fortunate not to concede when Myles Weston shot wide when well-placed after Saints gave the ball away before the same player skied over from 18 yards after good work from Joe Martin.
Gillingham did then have the ball in the net but Bradley Dack’s header was incorrectly disallowed for offside and Brackley survived until the break to take a one-goal lead into the interval and set themselves up for a huge FA Cup upset.
Gillingham, looking to rescue themselves from an infamous cup upset, came out with more purpose after the break and put the home side under some intense pressure, culminating in Martin’s 35-yard strike thundering off the post.
The visitors were all over Saints at the start of the second half and the home side struggled to get out of their own half with Leon Legge next to go close as his header looped just wide.
Saints then threatened themselves on the counter and twice came close to doubling their lead as, first, Steve Diggin’s shot was held by Nelson before Walker’s shot trickled wide.
Brackley stemmed the Gillingham tide and began to pose more of a threat with the impressive Walker cutting inside and drilling a low effort that had to be pushed around the post by Nelson.
Heading into the final quarter, Saints were now enjoying a fair share of possession, but substitute Chris Whelpdale forced a fine save from Worby before then lifting an effort over the young goalkeeper and onto the roof of the net.
Cody McDonald was next to be denied by Worby with the Gillingham pressure building by the second.
As time ticked away, Gillingham somehow, remarkably, failed to level in the 87th minute as Worby produced a wonder save to push a header onto the post before Whelpdale miraculously skied over from underneath the crossbar.
It was just meant to be for Brackley and they survived the four added minutes to record a stunning victory and spark mass celebration around a jubilant St James Park.
Brackley: Worby, Odhiambo, McDonald, Towers, Sharpe, Austin, Sandy, Solkhon, Mulligan, Diggin, Walker.
Subs not used: Story, Nisevic, Griffin, Jarvis, Collins, Mills, Cartwright
Gillingham: Nelson, Butcher (McDonald 65), Martin, Legge, Barrett (c), Mousinho, Dack, Lee, Akinfenwa, German (Whelpdale 60), Weston.
Subs not used: Howard, Carter, Davies, McKain, Hessenthaler
Referee: James Linington
Assistant referees: Adam Crysell and Chris O’Donnell