Glasgow win ding-dong battle