Scotland Edges Past UAE in Nail-Biting Finish