Donovan scored in the 117th minute, beating goalkeeper Tony Meola from six yards.
Ronnie Ekelund set up the winning shot, splitting two defenders with a pass to Donovan in the Kansas City penalty area.
The Earthquakes, the 2001 MLS champions, trailed, 1-0 and 2-1, but got clutch goals from Manny Lagos and Brian Mullan to stay in it.
Eleven minutes after the Wizards took a 2-1 lead on Chris Klein's 72nd-minute goal, Mullan took a cross from second-half substitute Ian Russell and scored from 12 yards to tie the score, 2-2, forcing overtime.
Klein set up Igor Simutenkov's goal from 16 yards in the 57th minute.
Four minutes later, Lagos tied the score, 1-1.