Erling Haaland struck a late winner as Manchester City edged a thrilling Champions League clash with RB Leipzig 3-2.