Crystal Palace staged a remarkable comeback against Newcastle United at Selhurst Park, with Jean-Philippe Mateta scoring twice late in the match.