David struck after 28 minutes and again deep into stoppage time to lift the French champions to eighth in the standings on 14 points from nine games as they continue to recover from a bad start to the season.
The result left Marseille, who suffered their first loss in the league last weekend against RC Lens, in fifth place also on 14 points, although the Provence side have a game in hand.
Earlier, leaders Paris St Germain, who have 24, dropped their first points of the season in a 2-0 defeat at Stade Rennes.
Lille, who have now won their last three Ligue 1 games, broke the deadlock when David latched onto Mehmet Zeki Celik's cross.
They had a chance to double the advantage after 74 minutes but Jonathan Ikone's strike crashed against the bar, three minutes before Cengiz Under was sent off for Marseille after picking up a second yellow card.
David wrapped up the points after five minutes of added time from point-blank range.