Donovan, who signed a multi-year extension with the Galaxy this week, scored his 132nd career MLS goal in the 26th minute for a 1-0 lead.
Keane followed with goals in the 43rd and 67th minutes for his 11th and 12th scores of the year as the Galaxy (13-9-4) strengthened their hold on second place in the Western Conference.
The Earthquake fell to 9-11-7.
Millions of Getty images now available for free via embed tool
Aaron Carter is still in love with Hilary Duff