Gala took the lead within ten minutes as Oliver McClymont ran onto a loose ball and drilled it into the bottom-left corner.
Five minutes before half-time, Andrei Samoila reacted quickly in front of goal to level the score.
However, Gala restored their lead before the half was over. Sam Ostle dribbled his way through a crowd of players before firing high into the goal.
Tynecastle came out flying at the start of the second half. Leon Byrne slammed home from the edge of the box four minutes after the restart and then again in the 45th minute to give Tynecastle the lead for the first time in the match.
Harris Fairgrieve swivelled in the box and equalised for Gala in the 57th minute.
With five minutes to go, Fraser Swan thought he had won it for Gala by poking the ball over the line after a goalmouth scramble but Tynecastle scored at the death, Jed Sneddon rifling a shot into the back of the net after Struan Woodford’s initial effort was blocked.
In the last play of the 90 minutes, Tynie’s Andrew Thomson pulled off some heroic defending as he cleared the ball off the line, keeping the score at 4-4.
Harrison Mutch scored the only goal in extra-time with a lovely bit of individual skill taking the final score to 5-4. Gala jubilantly hoisted the cup but both teams played a brilliant attacking game with neither deserving to lose.
Elsewhere, Spartans Whites Under-16s came from behind to beat Tranent Colts 2-1 and lift the Division 3 League Cup.
Tranent stunned their opponents as they scored with their first attack, Jake Brown netting from inside the box with the match yet to turn a minute old.
Tranent continued their dominance in the first half but couldn’t add to their early score with Miguel Corriea sharp inbetween the sticks for Spartans.
In the 56th minute, Kieran Harvey scored directly from a corner and started the Spartans comeback.
Six minutes later, Murray Skiffington slammed home and sealed the win for Spartans. Tranent proved worthy opponents but a second goal evaded them.
Tynecastle Under-15s advanced to the Inspiresport Scottish Cup final after a 4-1 win against AFC Glasgow.
Tynie took the lead in the 15th minute when captain Kyle Fraser bundled the ball over the line from a corner.
They doubled their advantage as a huge kick from goalkeeper Josh Philp was launched up the park and Sam Nicholson raced onto it, nipping in front of the keeper and finding the net.
Just before half-time, Callum Todd curled in a shot from 20 yards out to give Tynie a 3-0 lead.
Todd finished the tie off in the second half as he capitalised on a defensive mix-up and slotted home from ten yards.
Glasgow did manage to grab a consolation goal but it proved to be no more than that.
Tynecastle will face off against Musselburgh Windsor in the an all-Lothians final on May 19.