Merouane Zemmama and Paul Hanlon made the game safe but Irvine had already seen Richie Barr controversially booked for diving when appealing for a penalty and missed a glorious chance through Chris Strain, while Brian McGinty also hit the post.
Hibs boss John Hughes lived up to his promise to pick a strong side by making just one change from Sunday's Edinburgh derby, recalling Colin Nish in attack for suspended defender Darren McCormack.
Irvine, who beat Arbroath in November to set up the first ever cup clash between an SPL and junior side, arrived at Easter Road having not played a competitive match for more than a month.
But they boasted a number of former full-time professionals in their ranks and one of them even had the first two efforts on goal, ex-Rangers and St Mirren striker McGinty dragging a shot wide before firing over from long range.
The visitors were playing without fear, looking to hit Hibs on the break when possible.
Hibs left-back Hanlon then saw a shot blocked after a neat one-two with Nish before Stokes volleyed over David Wotherspoon's right-wing cross.
Riordan had the ball in the net when he headed home Zemmama's ball from point-blank range but the goal was disallowed for a push, much to the amusement of the significant travelling support.
There was plenty more ironic cheering from the away end as Hibs became increasingly careless.
And they survived a real scare in the 29th minute when former Easter Road trainee Barr beat goalkeeper Graeme Smith to a loose ball before going down.
The visitors screamed for a penalty but referee Euan Norris booked Barr for diving, to the vocal chagrin of team-mate McGinty.
It proved a pivotal moment as Hibs took the lead three minutes later when Ryan could only divert Wotherspoon's low cross into his own net with Riordan ready to pounce.
Chris Strain, son of the Irvine manager, wasted a glorious chance to level when he fired wide on the rebound after Smith had parried his first effort.
McGinty was then desperately unlucky when he saw his delicate looped curler come back off the post.
It was another turning point as a mazy run from Stokes three minutes before the break set up Zemmama to fire into the top corner from 20 yards via what appeared a slight deflection.
In stoppage-time, a vital interception from Ryan and a shocking miss from Nish prevented Hibs making it 3-0.
The second half heralded a flurry of snow as Hibs captain Chris Hogg became the second player booked for tripping Barr just outside the box.
There was plenty of unsavoury shoving in the area before David Lowing sent his low free-kick wide.
John Rankin looked certain to make the game safe for Hibs after dummies from two of his team-mates set him up, but Gareth Turner just beat the midfielder to the ball.
Strain then shot straight at Smith and Hanlon forced a fine near-post save from Michael Wardrope.
Hanlon got the better of the Irvine keeper on the hour mark when he was allowed to gallop towards goal unchallenged before slotting home.
Nish failed to connect from close range and Stokes saw an angled shot saved as Hibs looked for more goals.
Both sides then made two changes in the space of five minutes as the game began to wind down.
Hibs then took off Nish for Abdessalam Benjelloun.
Stokes was unfortunate not to net his eighth goal in six matches when he curled a brilliant shot against the post before Turner failed to find the target after a lovely move.
And there was to be no late consolation for the junior side, whose efforts were highlighted when the midfielder went off with cramp before a heavy touch prevented Stokes making it four.