Manchester City beat Sheffield Wednesday 2-1 to avoid an FA Cup replay thanks to James Milner's second-half double, the winner coming in stoppage time at the Etihad Stadium.