The 23-year-old Austrian moved to the top of the standings with a composed final run, but Germany’s Loch needed only to complete an error-free effort to be assured of a third successive gold.
Stunning climax
Having been flawless all weekend, the 28-year-old Loch crashed into the wall early in his final run, knocking him off medal pace and leaving a disbelieving Gleirscher jumping for joy in the leader's booth. His gold is Austria’s first in the event for 50 years at an Olympic Winter Games.
Gleirscher claimed the title with an aggregate time of three minutes 10.702 seconds, just 0.026 seconds ahead of runner-up Chris Mazdzer of the USA.
Germany's Johannes Ludwig won the bronze, while Loch could only finish fifth, ending eight years of Olympic dominance and his bid to match compatriot Georg Hackl's hat-trick of luge titles in the 1990s.
Fairytale finish
"This is quite unbelievable," said an ecstatic Gleischer, whose father also competed in luge at the Olympic Winter Games. "Indeed it has been like a fairytale ... I never made a podium at a World Cup and now here I am at the top of the podium."
It was a remarkable climax to a an event in which reigning champion Loch had set a new course record with his third run, only to see it bettered by Mazdzer, who clocked 47.534-seconds to leap into second place.
And Loch's disappointment was then compounded by that uncharacteristic error in his last outing. "One very bad run but that's sport," said the German philosophically.
Mazdzer meanwhile was thrilled with his silver, having been almost at "rock bottom" with his form only weeks before.
"It's 16 years in the making and what you dream about as a young child. Twenty years later you're finally on the podium," the 29-year-old said. "I don't know how to describe it."