Andros Townsend’s goal meant the Reds were behind at half-time on Saturday, but Mohamed Salah and Roberto Firmino scored to make it 2-1 to the hosts by the 53rd minute.
Palace got back on terms through James Tomkins, before Salah put the Premier League leaders back in front with 15 minutes left to play.
Sadio Mane’s 93rd-minute strike – which came shortly after James Milner had been shown a second yellow card – appeared to have wrapped up the win, only for Max Meyer to quickly pull one back for the Eagles.
Liverpool, though, saw out the remainder to extend their advantage at the top of the table to seven points.