The England international midfielder, who was convicted of using racially aggravated language towards Wolves midfielder Romain Saiss last month despite his denials, reminded manager Rafael Benitez of what he had been missing as the Magpies booked a trip to League One Oxford in the next round.
Matt Ritchie's early penalty and Yoan Gouffran's sixth goal of the season did the damage in front of a crowd of 34,896 as talk of a brewing transfer battle between Benitez and owner Mike Ashley was forgotten, although David Cotterill's late strike set up a tense conclusion before Ritchie struck at the death.
With promotion back to the Premier League the overriding priority, Spaniard Benitez shuffled his depleted pack to the extent that he handed senior debuts to youngsters Dan Barlaser on his 20th birthday, Stuart Findlay and Yasin Ben El-Mhanni, whose claims to fame include working as a body double for Cristiano Ronaldo and Neymar.
But it was Shelvey who stepped back into the limelight as his ninth-minute through-ball allowed Gouffran to escape from City skipper Paul Robinson and attempt to round keeper Adam Legzdins.
Referee Lee Probert pointed immediately to the spot after Gouffran was bundled to the ground and Ritchie converted with the minimum of fuss.
Shelvey himself tested Legzdins from distance with a dipping effort, but the keeper needed the help of a post to keep out Gouffran's audacious flick from Achraf Lazaar's 29th-minute cross.
However, the Frenchman increased the Magpies' lead within six minutes when he controlled Shelvey's free-kick with his back to goal before spinning and dispatching the ball into the bottom corner.
Ritchie would have had his second of the night three minutes before the break had his shot not come back off the inside of a post, but the lead was no more than Newcastle deserved despite Cotterill going close on three occasions during an early flurry from the visitors.
The Magpies repeatedly hit Birmingham on the counter after the break, but failed to take their chances and were made to pay when Cotterill's mis-hit 71st-minute shot eluded keeper Matz Sels.
Substitute Lukas Jutkiewicz might have levelled five minutes later but headed over, and Ritchie finally killed off the tie in stoppage time with Shelvey once again the architect.
Source : PA