The Crawley striker stabbed the ball home from four yards to give his side victory after Teddy Bishop was inches away from winning it for Blues in normal time, his thunderous shot from 30 yards smashing the underside of the bar.
Matt Clarke was handed his debut as Town made wholesale changes from the team that beat Fulham at the weekend, Kevin Bru coming in for his first start while Bartosz Bialkowski and Alex Henshall were other debutants.
McLeod fizzed a strike just wide in an even, opening 10 minutes that also saw Paul Taylor conjure up a clever free-kick to release Frank Nouble but his cross was over hit.
Nouble showed a great touch to get on the end of a long ball but he blasted well over the bar, Henshall then forcing a corner that Clarke headed over after a slick pass from Taylor.
Lanre Oyebanjo sent a powerful left foot effort wide for the home side, then at the other end Christophe Berra headed just past Brian Jensen’s post before Nouble was found by an excellent pass from Henshall but couldn’t convert from 15 yards in the clearest chance of the first-half.
Conor Henderson’s free-kick skimmed off McLeod’s head and away from danger, Taylor then leaving two defenders in his wake but his shot was smothered by the home defence as the first-half drew to a close goalless with Taylor sending a free-kick over the bar.
Nouble tested Jensen with a left foot effort as the second-half got underway with Town edging the play, Taylor threatening from the edge of the box after Henshall found him.
Elliott Hewitt’s cross was headed clear as Town turned up the heat on the home goal, the Wales U21 international then blazing another excellent delivery across goal.
Taylor was denied by the diving Jensen, Hewitt almost converting the rebound before Town made a first change with Jack Marriott replaced by Balint Bajner just past the hour.
Taylor’s shot was deflected wide as Blues continued to press, Bishop becoming the fourth Town debutant, replacing the impressive Bru for the final 15 minutes.
McLeod lofted a chance well over the bar with Bialkowski out of his goal, Darren McQueen then handed his first appearance in a Town shirt at senior level, Taylor making way.
Jensen beat out Bajner’s right foot effort from 20 yards, then Gwlon Edwards failed to test Bialkowski from inside the box as Crawley enjoyed some pressure on the Town goal.
Bishop had the Blue Army on their feet two minutes from time when he rattled the crossbar with a fantastic strike from 30 yards right in front of the travelling support, then
McLeod had the chance to win it for Crawley with virtually the last kick but Bialkowski denied the former Derby striker to take the game into extra-time.
Luke Chambers had to be alert to clear from McLeod, then Bialkowski was quick off his line to see off the danger as the Crawley frontman looked to get in on goal.
Jimmy Smith whipped in a free-kick that beat everyone as Crawley shaded the first-half of extra-time without finding the breakthrough.
Chambers shadowed McLeod to concede a corner and eventually it was the striker who found the net, forcing the ball in from close range on 110 minutes after it had cannoned around in the Town box to give his side a place in the second round.
Crawley: Jensen, Oyebanjo, Henderson (O’Connor 93), Leacock, Bradley, Edwards, Smith, McLeod, Walsh, Young (Banya 55), Bawling (Dickson 60). Subs not used: Essam, Rose, Richeford, Isaacs. Booked: Henderson, Smith, Edwards.