Bernardez lined up for a free kick in the 94th minute and grounded a shot that got through the Galaxy's defensive wall and reached goalkeeper Josh Saunders, who bobbled it before letting it sneak past him into the net.
Jon Busch made two saves for the Earthquakes, who will seek to close out their Western Conference series when the scene shifts to San Jose for Wednesday's second leg.
The closest the Galaxy came to scoring was when Robbie Keane blasted a shot off the crossbar off a leave from Landon Donovan in the 86th minute.
Ukrainian protestors topple Lenin statue [VIDEO]
Reindeer recovered after escaping from Santa during lighting ceremony