In a match played over four periods of 30-minutes against the stunning backdrop of the Julian Alps in north-west Slovenia, the Hatters trailed to a 46th minute goal for the hosts, from the capital Ljubljana, who finished fifth in their league and runners-up in their domestic cup last season.
After spurning three good chances to equalise, Town did eventually find a leveller soon into the final quarter with Dion Pereira rifling in from eight yards after a spell of pinball in the Bravo penalty area, caused by a Harry Cornick long throw.
Cornick, who netted 13 times last season, was soon in on the act himself, heading the Hatters in front in the 112th minute after a deep corner had been twice headed back across goal for the former Bournemouth man to nod in from close range.
First Hour XI: Horvath, Bree, Lockyer, Bradley, Onyedinma, Campbell, Freeman, Bell, Woodrow, Morris (Jerome), Muskwe.
Second Hour XI: Macey (Isted), Burke, Osho, Potts, Thorpe (Watson, Pereira), Berry, Clark, Doughty, Mendes Gomes, Adebayo, Cornick.
Goals:
Pereira 91, Cornick 112