Liverpool took the lead when Adam Lallana punished Martin Kelly’s mistake with a fine finish after 26 minutes, but Palace then assumed control of the game and equalised through the outstanding Jason Puncheon’s free-kick two minutes before the break.
The visitors moved ahead when Wilfried Zaha bundled home in the 60th minute with his first touch just 23 seconds after coming on, and fellow substitute Glenn Murray wrapped up the victory by stroking home the rebound from his own saved penalty in injury time.
Driven on by a visibly motivated Gerrard, Liverpool applied heavy pressure in the last 15 minutes but Palace fully warranted the three points and denied a captain desperate to end on a winning note at home.
The result sees Liverpool remain fifth and mathematically ends their chances of finishing in the top four, while Palace stay 12th but are now just two points off the top half.
Prior to kick-off, Gerrard emerged from the tunnel with his three daughters to a guard of honour from the two teams and a rousing rendition of You’ll Never Walk Alone from the Liverpool fans.
The first 25 minutes passed without incident as the game took on the feel of a testimonial, but then the hosts were gifted the lead when former player Kelly misplaced a pass to central defensive partner Scott Dann and inadvertently played in Lallana, who finished well high into the top-left corner.
Palace had begun to show signs of improvement prior to the goal and they created four excellent chances to equalise in the next eight minutes. After Joe Ledley and Yannick Bolasie had blazed over from the edge of the box, Puncheon had a curling shot well saved by Simon Mignolet and then Chung-Yong Lee scooped over with a back-post volley following a corner.
The visitors were now well on top and they deservedly levelled when Emre Can scythed down the marauding Bolasie and Puncheon subsequently scored a set piece for the second Saturday in succession by sweeping the resulting free-kick across goal and into Mignolet’s bottom left-hand corner.
Liverpool’s back three was struggling to cope with Palace’s lively front trio of Puncheon, Marouane Chamakh and Bolasie, but Liverpool manager Brendan Rodgers persisted with his 3-4-3 formation and Alan Pardew’s side duly continued to benefit after the break.
Puncheon fired over within two minutes of the restart and then the visitors had two penalties turned down in quick succession, both of which appeared to be valid claims.
Liverpool finally woke up just before the hour and went close with efforts from Philippe Coutinho and Jordan Henderson, but Palace continued to push on and deservedly took the lead when Zaha scuffed home Bolasie’s low right-wing cross.
Bolasie almost made it 3-1 with left-foot shot from 15 yards after 66 minutes that cannonded off the crossbar, and although Henderson and Gerrard both saw shots fly wide as the hosts pressed for an equaliser, Murray’s late goal did not flatter the impressive away team.
Liverpool: Mignolet (6), Can (6), Skrtel (6), Lovren (4), Ibe (6), Gerrard (6), Henderson (6), Moreno (5), Lallana (6), Coutinho (6), Sterling (5).
Subs: Lucas (5), Lambert (6), Sinclair (6).
Crystal Palace: Hennessey (6), Ward (6), Kelly (5), Dann (7), Souare (6), Puncheon (9), McArthur (7), Ledley (7), Lee (6), Chamakh (7), Bolasie (8).
Subs: Zaha (7), Murray (7), Mutch (6).
Man of the match: Jason Puncheon