Alloa have been relegated from the Scottish Championship after a 2-1 defeat to Raith.
The bottom side needed to win all three of their remaining games while hoping other results went their way and, while they took the lead in the first half, they could not recover from having goalkeeper Neil Parry dismissed after the break.
Kyle Benedictus had an early chance for Raith but Jon Robertson and Stefan Scougall responded before the home side took the lead midway through the first half.
Robertson's ball found Kevin Cawley at the back post and the midfielder tucked home to put Alloa ahead in the 23rd minute.
But it all started going wrong at the beginning of the second half as Parry brought down Gozie Ugwu in the penalty area and was sent off, with the striker converting the spot-kick in the 56th minute.
Just five minutes later, the game had turned on its head as Regan Hendry did well down the left and set up Dylan Tait to convert from close range.