Scotland earned a vital 1-0 victory over Croatia in the Nations League on matchday five thanks to late substitute John McGinn, who converted the rebound after Ben Doak's shot was parried.