Although it looked as if San Jose were calling for an offside, the Irishman
timed his run to perfection to meet David Beckham's free-kick from the halfway line.
San Jose goalkeeper Jon Busch looked extremely hesitant and failed to deal with the attack, allowing Keane to place the ball into an empty net, thus giving Galaxy
a 1-0 lead.
replaced Keane - who received a standing ovation - in the 72nd minute, before doubling Galaxy's lead in the 90th minute. The goal came after Earthquakes' midfielder Steven Beitashour was shown a red card just eight minutes from time.
Speaking after the match, Keane said
: "It couldn't have gone better for me. When you come to a new team, it's always good to get the first goal.
"When you go a few games without a goal, it starts to play on your mind."
Meanwhile, Beckham added
: "He's a player who knows where to run, and if you're on the same wavelength as him, you've got a real good chance.
"He's always going to make good runs, and it's up to us to find him."
Galaxy remain top of the MLS Western Conference on 54 points - six clear of Seattle Sounders.