Mark Reynolds scored the key spot-kick after Jamie Langfield had saved from Michael Doyle but the Dons lost both Willo Flood and Jonny Hayes to injury in the second-half.
The impressive Peter Pawlett was the chief threat for Aberdeen in the opening period and he drew a good save from Scott Bain before putting another effort narrowly wide from distance.
The visitors went very close in between when Langfield parried a Jason Marr header from a corner onto the crossbar.
The Wasps then tried a training ground free-kick routine after the break and Ryan McCord found Stephen Simmons, who could only shoot high and wide.
Flood was then forced off and he was followed by Hayes, who came off worst after a very nasty clash of heads with Daryll Meggatt.
Alloa threatened again through substitute Eddie Ferns when he got past Russell Anderson before shooting into the side-netting.
Anderson was then involved at the other end, going down in the box, but referee Stevie O'Reilly was unmoved by the penalty appeals.
Chances were thin on the ground in the extra period and Langfield then made the key save in the shoot-out, diving to his left to push Doyle's shot away.
That put the pressure onto Reynolds and he calmly despatched his spot-kick to put Aberdeen through after a hard-fought encounter.