The Scots left it late to leapfrog the hosts and avoid immediate relegation from the top tier of the Nations League