The former Rovers front-man, who scored 23 goals during his two campaigns in Kirkcaldy, decided the contest when he latched on to a marvellous Jon Robertson pass in the first half to slot beyond Kevin Cuthbert.
The result sees Alloa progress from Group D in top spot, having also eliminated holders Ross County, and they will be seeded in the last 16 after a hugely impressive four wins from four.
Skacel, in his first outing on these shores since his utterly forgettable one-season stint with Dundee United ended in May 2013, entered the fray as a second-half substitute after his FIFA registration was rushed through.
Nevertheless there was to be no fairytale return for the man who lifted the Scottish Cup with Hearts in 2006 and 2012 as Raith exited the competition.
“I’ve said to the players in the dressing room that they should talk up what they have achieved,” said Alloa boss Jack Ross.
“That is not to say we will get carried away going in to the league season, but what they have achieved in this competition has been fantastic.
“To go through a really tough group – the holders [Ross County] and Raith Rovers in the last two – with a 100 per cent record is terrific.
“We set the goal to win this group. People might say ‘it’s easy for you to say now’, but that was the target. If you don’t aim high then you won’t get there, so that is the first major target chalked off.”
Alloa, seeking another scalp following their 3-2 win over Premiership side Ross County on Tuesday, threatened as Jordan Kirkpatrick shot wide from distance before a Jamie Longworth header found the grateful arms of Kevin Cuthbert.
Lewis Vaughan, sporting a Lionel Messi-style peroxide hairstyle, could not quite emulate the Argentine icon with a free-kick from 25 yards which drifted narrowly off target. He then directed another shot agonisingly wide of the post.
Raith should have claimed the lead midway through the first have when Neil Parry could only fist a speculative Declan McManus drive into the path of Kevin McHattie, but the Alloa stopper made amends with a super stop.
And the hosts were made to pay for their profligacy when Robertson carved open the Rovers defence with a stunning pass, sending Spence scampering clear on goal to fire beyond Cuthbert. Skacel, a Hearts legend after two spells at Tynecastle which saw him win the Scottish Cup twice and score 48 goals, entered the fray on the hour mark as Gary Locke sought parity.
However, it was fellow substitute Joel Constrain who almost claimed a leveller when he saw a goal-bound shot deflected just wide.
“I told the players that we needed a result today or all our work in the group would be for nothing – and that’s what has happened,” rued Locke.