A local FA Vase derby produced a brilliant spectacle as the Bulls came from two goals down to win the battle of the Forest Town Arena.
On either side of a red card for striker Jermain Palmer the underdog visitors struck twice through Callum Lytham and Declan Brewin to earn a shock 2-0 lead, but Matt Chatfield's Bulls recovered with a Jordan Annable goal just before half-time to then go on and turn the tie on its head.
AFC dominated the opening 10 minutes as expected, and could have been ahead if Jack Warwick's low drive from the left had better connection, before he headed skipper Phil Buxton's free-kick just over the crossbar.
But against the run of play, Rainworth converted their first chance of the afternoon as Callum Lytham pounced on Nicky Darker's scuffed backpass and slotted expertly under Hugo Warhurst.
The opener changed the nature of the afternoon, and the visitors continued to question a sleepy Bulls defence with Jermain Palmer and Declan Brewin both squandering begging chances.
As the minutes went by AFC looked continually out of the game, whilst Brad Cox saw his long range effort crash against Warhurst's near post from a tight angle.
Ross Duggan almost levelled in spectacular style not long after with a rare chance for the hosts, forcing a fine save from Warren Squires who palmed away his sweetly-hit dipping volley.
Just after the half-hour mark, it looked like AFC's luck was beginning to turn as striker Jermain Palmer was given his marching orders for an elbow-led challenge.
But only two minutes later at the end of a frantic few minutes did the deficit double - Declan Brewin saw an initial point-blank range effort blocked by Warhurst before firing home on the rebound.
The Bulls were in desperate need of a boost before the break, and defender Jordan Annable provided a much-needed goal on the very brink of the half-time whistle, emphatically volleying Ross Duggan's lobbed ball past Squires.
Matt Chatfield's side then came out of the blocks in the second half and quickly drew level when Ross Duggan latched onto Warwick's headed through-ball and laced the ball into the far bottom corner.
From that moment, the hosts looked to establish dominance and push on for victory, and almost took the lead when Duggan's deflected cross almost found the feet of Warwick in the perfect position in front of goal, but the ball sailed past before the goalless striker could get a touch.
After plenty more minutes of nerves and frustration, the Bulls' constant pressure on their guests finally paid off on 82 minutes when Brandon Webster twisted and slotted the ball home in the far corner from a Nicky Darker long throw.
If not for a slice of luck the tie would have, in fact, headed for extra time, but Warhurst did well to quickly recover when he spilled the ball right into the path of substitute Ethan Knowles.
After a ridiculous yet entertaining 90 minutes of football, the Bulls survived six minutes of injury time to advance to the First Round Proper.
Final score | AFC Mansfield 3-2 Rainworth MW
Scorers | Annable (45'+3), Duggan (53'), Webster (82') - Lytham (10'), Brewin (33')
Bulls XI | Wahurst (GK), Annable, Hague (Webster 46'), McGuire, Lucas, Darker, Warner, Buxton (C), Duggan, Warwick (Williams 90'+4), Hough (Slone 37')
Unused substitutes | McMillan, Corder
Yellow cards | Duggan (37')
Rainworth MW XI | Squires (GK), Herbert, Toon, Drake (Davidson 71'), Timons, Wright, Brewin (Knowles 79'), Cox, Palmer, Harris (C), Lytham
Unused substitutes | Spencer, Adeleye, Hardwick, Smith (GK)
Yellow cards | Cox (75')
Red cards | Palmer (31')
Man of the Match | Ross Duggan
Attendance | TBC