Manchester City survived a first-half scare to boost their Champions League hopes with an emphatic win.