City took the lead in 28 minutes when John Dodds blocked a point-blank shot from Mark Osborne and Ross Guthrie tapped in the loose ball
The visitors went two up after Ian McFarland, unchallenged, lashed in a shot from 30 yards.
But City’s lead lasted only three minutes, Ross Aitchison heading a right-wing cross over Andrew Stobie, and the home side drew level two minutes from half-time when Jamie Gibson launched his own 30-yard effort.
Gala took the lead six minutes after the break, Ashley Langford nodding home. In 62 minutes the Gala keeper didn’t clear a corner and Guthrie scrambled the ball home. Ross Allum made it 4-3 for City and he scored again when one on one with the keeper. He then got his hat-trick when curling the ball around the wall from 25 yards.
Gala FR: Dodds, Stephen, Commmon, Hossack, McBride, Devlin, Aitchison, Bonnar, Langford, Gibson, Robertson. Subs: Thomson, Gavin, Miller, McColm, Noble.
Edinburgh City: Stobie, Caddow, Donaldson, Guthrie, Paterson, Mbu, McFarland, Torrance, Gair, Dunn, Osborne. Subs: Vanson, Wishart, Allum, Stenhouse, Triallist, McKee, Triallist.