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.
Exploding whale video goes viral on Internet
Couple calls 9-1-1 over missing hash browns; assault McDonanld's employees