Late goals give Newcastle win over Palace