Carson was beaten twice from the spot by Ben Doherty in the second half as Motherwell let slip a two-goal lead following first-half efforts from Callum Lang and Tony Watt at The Showgrounds.
The equaliser came in the last minute after Bevis Mugabi had been sent off but Carson ensured the game went to penalties after touching Eoin Bradley's header on to the bar in extra-time.
And the Northern Ireland international saved all three of the home side's spot-kicks after the 2-2 draw.
Mark O'Hara, Tony Watt and Stephen O'Donnell netted from 12 yards to send Motherwell into the third qualifying round, where they are due to face Hapoel Beer-Sheva in Israel.
Gallagher said in a video posted on Motherwell's Twitter account: "We're absolutely delighted to get to the next round.
"We cannot be put in that position where we come out that sloppy in the second half, our first-half performance should have seen us out of sight.
"But it's a one-legged tie, they were at home, these things can happen in football, that's just what it's like.
"At the end of the day, Trevor Carson, absolute hero, and some of the boys when we went down to 10 men showed their worth.
"So proud of the boys, we are through to the next round, and that's all that matters."