A goal from substitute Aiden Connolly in the 86th minute saw York City beat Macclesfield Town 3-2 to lift the FA Trophy at Wembley.