Thistle made hard work of what should have been an easy three points in what turned out to be a seven-goal thriller. However, visitors Alloa will be aggrieved to leave Glasgow empty handed.
There were few chances for either side in the opening exchanges before Thistle began to stamp their authority on the match. Graham Dorrans in the 15th minute and Darren Brady four minutes later both had good chances.
However, it was Alloa who took the lead after 30 minutes when James Stevenson picked up the ball in a harmless position and was allowed to shoot from 25 yards. His shot caught out Colin Stewart in the Thistle goal and sailed high into the far corner.
Buoyed by this success, Alloa doubled their advantage 10 minutes later when Robert Sloan won a challenge in midfield, and as he bore down on goal, shrugged off a challenge from Ricky Gillies to shoot firmly into the net from 12 yards.
As half time approached, Thistle pulled one back when a Dorrans cross was met perfectly by Stephen McConalogue, who volleyed home from eight yards.
Thistle drew level after 62 minutes when a brilliant back heel from McConalogue was met by Billy Gibson, who beat two defenders to fire into the net from 10 yards.
Alloa hit back after 69 minutes when Sloan found space on the wing and his cross was bravely met by Andy Brown, who dived between two Thistle defenders to head home from three yards.
With the disapproval of the home support ringing in their ears, Thistle managed an equaliser on 81 minutes when Scott McCulloch fired a low drive into the bottom far corner from 20 yards.
Thistle stole victory in the 86th minute when a McCulloch cross was missed by everyone except Dorrans, who headed into an empty net from close range.