Gallacher pushed away Thompson’s 42nd-minute penalty after another player who left Paisley for Dunfermline in the summer, John Potter, had conceded a penalty.
After four years out of the top flight, Dunfermline found St Mirren’s passing and movement difficult to deal with, especially in the first half, and rarely threatened going forward, although they twice came close from Martin Hardie free-kicks.
St Mirren, who also had Jeroen Tesselaar, Gary Teale and Nigel Hasselbaink making debuts, carved out several other decent openings but failed to work Gallacher enough.
Dunfermline took just two minutes to create their first chance when Hardie headed on Gallacher’s free-kick to David Graham in the right channel, but the winger sliced high and wide.
It proved a false dawn and Paul McGowan quickly created two chances for himself at the other end.
McGowan turned and shot a yard wide from the corner edge of the box and then started and almost finished a sweeping move, taking an inside pass from Hasselbaink, side-stepping Potter before Gallacher diverted his shot wide.
The home side were struggling to handle St Mirren’s switches of play and Darren McGregor was close to converting Teale’s back-post corner.
Both Saints full-backs were overlapping to good effect. David van Zanten saw a shot blocked after exchanging passes with McGowan and Tesselaar combined well with Hasselbaink before the former Hamilton forward cushioned a volley just over.
Hasselbaink shot straight at Gallacher on the run after on-loan Hearts full-back Jason Thomson had lost possession.
But St Mirren almost fell behind in the 39th minute when Hardie curled a free-kick which was dropping just under the bar before Craig Samson pushed it over.
Referee Stevie O’Reilly soon ruled Potter had held Thompson as the striker tried to glance on Teale’s inswinging free-kick.
The former St Mirren captain complained vehemently but Gallacher rescued him as he dived to his left and pushed away Thompson’s spot-kick.
St Mirren switched their forward three midfielders around at half-time, Teale swapping flanks to the right, McGowan moving outside and Thomson now in the centre ahead of skipper Jim Goodwin, who was assured in the holding role.
They continued to dominate without being afforded as much room in the Dunfermline half.
Saints created an early chance when Teale poked the ball just wide as the hosts struggled to deal with a free-kick into the box, and Gallacher got down well to hold Thomson’s volley following a cross from Hasselbaink.
Thompson had another good chance midway through the half when Teale’s wide free-kick found him on the edge of the six-yard box but the striker cushioned his volley just wide.
Hardie came close with another 30-yard free-kick – so close most of the stadium celebrated as the ball rippled the outside of the net.
Hasselbaink, moments after being booked for a late tackle on Alex Keddie that had the home fans baying for red, curled straight at Gallacher from a decent position and Dunfermline enjoyed one of their most comfortable spells to see out the closing stages.