The hosts spurned numerous opportunities, and were made to pay when Dwight Gayle prodded in a close-range finish to make it 1-0 to the Eagles at half-time.
Fulham improved significantly after the break and got a deserved equaliser just after the hour mark when Cauley Woodrow curled a superb strike past Wayne Hennessey.
Palace thought they had won it when Gayle claimed his second of the game, curling home a wonderful free-kick from 25 yards out.
But Fulham’s 13-year stay in the Premier League ended on a lighter note, as David fired home a spectacular effort to claim a late point.
Fulham owner Shahid Khan confirmed his commitment to the club in the matchday programme, setting the target of an instant return to the Premier League.
Felix Magath was more cautious a page later, however, stressing in his manager’s notes that climbing out of the Championship “may take some time”.
Magath has the “complete faith” of Khan, but that backing was issued alongside a reminder that the German has “significant responsibility” and knows “my expectations are demanding”.
There was no doubt who Khan blames for the club’s relegation, however, after branding the contribution of some members of the squad as “simply unacceptable”.
And Khan will have seen little in the first half to prompt him to reassess his opinion.
Woodrow showed tenacity to create an early chance, but having twisted and turned his way into a shooting position, his effort was cleared to safety.
Palace broke with greater purpose when given the opportunity and Tom Ince should have done better when he sprinted to the edge of the area.
Substitute David, on for the injured Alexander Kacaniklic, was making a good early impression as he teed up a tricky chance for Hugo Rodallega who just failed to reach the ball.
The action continued to escalate in Fulham’s half, however, with keeper David Stockdale producing a fine save to deny Yannick Bolasie.
Palace made the breakthrough in the 28th minute when a long-range effort by Joel Ward that was bound for the arms of Stockdale, was cleverly poked home by Gayle.
Fulham ended the first half brightly with Fernando Amorebieta going close with a far-post header that was scooped aside by Hennessey, but Palace deservedly entered the interval ahead.
Somehow Rodallega managed to nod Amorebieta’s cross wide from close range when he had the goal at his mercy and then David lofted a shot high over the crossbar.
The pendulum had swung and Fulham were now in full control, a fact underlined by Woodrow’s 61st-minute equaliser.
Atoning for his earlier blunder, Rodallega shielded the ball from a gang of defenders before sliding a superb pass to Woodrow who turned Ward inside out before driving home.
Steve Sidwell and Marouane Chamakh squared-up after tangling as they fell to the floor and the Moroccan was substituted seconds later.
Fulham’s fightback looked likely to fail, however, as Gayle curled a free-kick through a shambolic wall and beyond the grasp of Stockdale for his second.
But with seconds remaining, David intervened to deny Palace victory.