Trailing 1-0 from the first leg, the Saints drew level when Michael O’Halloran fired home an angled drive from 18 yards after 38 minutes at McDiarmid Park.
The Scottish side were given a further boost to their chances of qualification when Karen Muradyan was sent off for a second booking midway through the second half.
But Norayr Gyozalyan’s clinical finish on 72 minutes made it 1-1 on the night and gave Alashkert the away goal which was to prove vital.
Brad McKay put the Saints 2-1 up with four minutes left to play to set up the grandstand finish at McDiarmid Park.
However, Scott Brown failed to hit the target with a late chance and St Johnstone exited the competition.