The striker saw 81 minutes of action but his presence could not forestall an away reversal at Anfield. Andros Townsend put the visitors in the lead in the 34th minute, but Egypt attacker Mohamed Salah equalised in the first minute of the second half to set up a thrilling 45 minutes.
Roberto Firmino put Liverpool ahead for the first time with a 53rd-minute strike but James Tomkins headed home Luka Milivojevic's corner to restore parity in the 65th minute.
Salah netted his second goal of the game in the 75th minute to put The Reds 3-2 up, the goal hugely influenced by a goalkeeper Julian Speroni's howler.
Sadio Mane made it 4-2 for Liverpool in the third minute of stoppage but Max Meyer scored for Palace two minutes later to reduce the deficit.
The result consolidates The Reds' lead on the table, with The Eagles left on the 14th position.
Ayew, who picked up a 42nd-minute yellow card for a foul, was replaced by Connor Wickham nine minutes to full-time.
The game was his 11th league start of the season and his 15th appearance in total.
Compatriot Jeffrey Schlupp joined the action in the 75th minute, taking the place of Cheikhou Kouyate.
It was the German-born's 19th outing of the campaign.
Palace host Tottenham in their next game on January 27.