A goal from Gyasi Zardes gave the Galaxy three points as the team returned to league play.
The move began with Landon Donovan trying to slip a ball into Robbie Keane, who in turn carried it back away from goal, played a quick one-two with Robbie Rogers to give himself time to turn, and then played a lovely ball into Marcelo Sarvas.
PHOTOS: USA vs. Portugal | U.S. fan reactions | Beautiful people in Brazil
Sarvas laid the ball off cleverly in the San Jose box, and Zardes smashed home the winner just after the hour mark.
The win opens up a four-point gap for the Galaxy over San Jose, though both sides are still lingering just outside the playoff spots in the Western Conference.