Paul Hart’s side trailed to an eighth-minute opener from Keith Treacy, but freescoring Palace midfielders Neil Danns and Darren Ambrose struck either side of the break and Calvin Andrew hit his first league goal of the season to settle the nerves late on.
The Eagles have taken an impressive seven points from their last three games to give themselves more than a fighting chance of beating the drop.
They are now only four points behind Preston, who will be glancing uneasily over their shoulders until they get at least one more win on the board.
Palace almost got off to a dream start after just 60 seconds when Sean St Ledger failed to deal with a long clearance from Julian Speroni and Stern John fired narrowly over the crossbar.
They came even closer in the seventh minute when Ambrose swung in a corner and Paddy McCarthy’s header was cleared off the line by Tom Williams.
But Palace were caught cold from the ensuing Preston counter-attack after skipper Shaun Derry was caught in possession and lone defender Matt Lawrence was left with three attackers bearing down on him.
Paul Coutts played the ball in to Treacy and he was able to coolly slide it past exposed home goalkeeper Speroni.
The Eagles attempted to hit back and North End keeper Lonergan, making his 200th career appearance, marked the milestone with a superb reaction save to keep out Andrew’s near-post header.
But Lonergan was beaten five minutes before half-time when Preston failed to deal with Andrew’s cross and Sean Scannell headed into the path of Danns, who poked in his ninth goal of the season from six yards.
Palace felt they should have had a penalty in first-half stoppage time when Elliott Ward appeared to handle in the area but referee Roger East was unmoved.
But they only had to wait until five minutes after the restart to go ahead thanks to a surging run from Danns, who charged into the Preston box and pulled the ball back for Ambrose.
The midfielder cracked his shot against the underside off the crossbar and just beyond the line for his 19th goal of the campaign.
Andrew could have given his side some breathing space when Ambrose sent him scampering through but his finish was too close to Lonergan.
But the former Luton striker finally broke his goal duck to seal the win six minutes from time – a close-range finish past Lonergan after more good work from Ambrose.