Dogged and committed Oxford City held on until the 108th minute before Udoh swept home to break the non-league visitors’ hearts to blue and amber relief.
Shrewsbury, who like Oxford finished the tie with 10 men after Aaron Pierre and James Roberts were dismissed for a controversial coming together, pocketed the £25,500 prize money as Cotterill started with an eventful win.
Town made the third round for a fourth season running and a fifth time in six attempts as the brave National League South visitors just failed to hold out for penalties. Town also claimed more than £37,000 in broadcast fees.
Striker Udoh, like a few weeks ago under axed boss Sam Ricketts, proved the late hero from the bench again.
Cotterill received a huge boost ahead of kick-off in the form of goalkeeper Matija Sarkic’s return from a hamstring injury sustained in the league draw at Plymouth over two months ago.
Scott Golbourne provided another fitness boost, the experience left-back - who enjoyed a fine start to the season - has been out for more than a month with a rib injury but returned to the bench.
Cotterill stuck with Town’s three centre-halves and his selection of midfielder Sean Goss, who was left out in the cold under Sam Ricketts and not registered for league action, caught the eye of supporters.
The new Town boss, appointed 48 hours earlier after Wednesday’s dismissal of Ricketts, resisted naming strikers Udoh and Jason Cummings in his starting XI, again sticking with attackers Shaun Whalley and Marc Pugh, who were electric at MK Dons on Tuesday, in his 3-5-2.
Dave Edwards, who featured in the infamous defeat at Histon some 16 years ago, played in the attacking midfield role he occupied so well with Wolves.
The National South visitors were without suspended skipper Joe Oastler. David Oldfield’s men were winless in four since they so impressively beat Town’s League One rivals Northampton 2-1 in round one.
They added powerful defender Ben Gerring on loan from Woking just before the clash.
The Meadow tie had been billed as one of the biggest in City’s 137-year history as they aimed to bridge the 61-place gap between the sides.
After a period of remembrance for Diego Maradona, Town were sharply into their stride under the relentless barking instructions of a busy Cotterill in his technical area.
Cotterill began coaching almost instantly. A passing style was immediately evident, particularly out of defence from the centre-halves and goalkeeper Sarkic.
It was a style Town were not particularly familiar with and were having to learn on the task. At times Sarkic’s pass went astray but Cotterill’s encouragement was relentless, as was his coaching of Vela at right wing-back.
Oxford, having already progressed through four rounds, worked their way into the context and grew in confidence themselves, showing keen energy in pressing and bravery on the ball as members of a league renowned for its passing style.
Much of the first half hour passed without any goalmouth incident of note. Town, constantly coached by Cotterill - flanked by Brian Jensen and academy boss David Longwell - from the sideline, were trying to adjust to a new style as City’s belief grew.
Neither side threatened either goalkeeper, Edwards’ angled volley flew wildly over in the hosts’ first effort. Sarkic’s handling impressed.
Whalley and Pugh, as Town’s attackers, were being tightly marshalled and received some rough treatment at times from the part-time visitors.
The game’s first chance arrived three minutes before the break. Ro-Shaun Williams’ lofted pass out-foxed the City backline and played Whalley in on goal. Town’s No.7 had all the time in the world and opted for a difficult chip, which was claimed by Ben Dudzinkski.
Shrews ended the half on the front foot having grown into the tie but needed to move the ball quicker.
Golbourne completed his injury return as a half-time change for Ethan Ebanks-Landell, who was feeling the effects of a first-half head injury.
Pugh’s press almost forced an instant second-half opener as Whalley’s six-yard effort was well blocked, as was Ollie Norburn’s rebound.
James Roberts kept Sarkic honest with a 20 yard strike.
Town lost Edwards to a knock from a late challenge before Whalley hit a decent strike across goal from the edge of the box as the visitors tired.
Midfielder Goss, previously out of favour, began pulling the strings and dictating play. But Shrews were then grateful to a key Sarkic save to deny Gerring’s back post header before Cotterill sent on Udoh.
But experienced sub Elliot Benyon robbed Goss and saw a deflected strike fly inches over with under 20 minutes left.
A flashpoint saw two reds flashed by referee Christopher Pond as Pierre and Roberts came together on halfway. Pierre appeared to take a blow to the head before Roberts was left rolling around. Replays suggest Pierre, who was visibly shocked, was very hard done by.
Lewis Coyle was almost the hero seconds later after a super spin and dart into the box but Sarkic saved his low shot.
Town almost won it in the last minute with extra looming. A lovely move down the right flank involving Norburn and Millar fed Pugh whose delightful chip was cleared off the line by Aaron Drewe.
Cotterill led a on-field team talk ahead of extra time in an eventful first game in charge of Salop.
Town were brave in their 10-man approach, with just Williams and Charlie Daniels as a back two.
Cotterill used the further change permitted in extra time to send on Cummings, whose strike at the back post from a corner drew a fantastic block before dogged City defenders then somehow deflected Millar and Cummings goalbound shots behind as Oxford clung on.
Shrews continued to ask questions from the off in the second period and needed just two minutes to finally break through.
City could only half-clear a couple of deliveries and, from a shanked Pugh volley, Udoh spun and swept home a low finish to the relief of all concerned.
Oxford looked defeated and depleted but they didn’t give up. Jacob Bancroft was almost free in the box before skipper Reece Fleet curled inches wide from distance.
Cummings should’ve killed the tie in the 117th minute but took too long and fired across goal and wide. Town, with Sarkic a confident presence throughout, held out to the relief of all concerned.
Shrewsbury Town (3-4-1-2):
Sarkic; Williams, Ebanks-Landell (Golbourne, 45), Pierre; Vela, Goss (Udoh, 79), Norburn ©, C Daniels; Edwards (Millar, 57); Pugh, Whalley (Cummings, 102).
Subs not used: Burgoyne (gk), J Daniels, High.
Oxford City (4-3-3):
Dudzinski; Drewe, Fernandez, Gerring (Matsuzaka, 75), Hall; Ashby, Fleet ©, McEachran (Bradbury, 90+4); Coyle (Bancroft, 103), Roberts, Owusu (Benyon, 60).
Subs not used: Grantham (gk), Martinez, George.
Referee: Christopher Pond