Los Angeles won the two-match, aggregate-score series 3-2, producing a sensational first half on the Earthquakes' home turf.
San Jose won the opening game of the series 1-0 and with that away victory in hand entered Wednesday's contest as the heavy favorite to capture the Western Conference semifinals.
Keane, however, scored in the 21st and 34th minutes and Mike Magee added a goal in the 39th minute to put the Galaxy in charge.
Alan Gordon gave San Jose hope with a goal in the 82nd minute, but Los Angeles held on to set up a conference final series against either Seattle or Real Salt Lake. Those two teams meet Thursday in the second leg of their semifinal series, having played to a scoreless draw in Seattle last week.
Keane opened the scoring by driving a shot from outside the penalty area into the bottom left corner of the net. His second goal came at the end of the break following a through ball from Landon Donovan.
Donovan also assisted on Magee's goal.
The teams with the best records in both MLS conferences have now been eliminated from the playoffs.
San Jose owned the best regular-season mark in the league this year. Kansas City, which finished on top of the Eastern Conference standings, was knocked out of the playoffs earlier in the evening by Houston.
UPI horse racing roundup