San Jose got its first home win since May 1 and ran its unbeaten streak to seven games (2-0-5).
The Earthquakes' Jackson Yueill hit the cross bar with a shot in the ninth minute, which foreshadowed what happened moments later.
After a foul and yellow card to LAFC's Jesus David Murillo, Espinoza's free kick from the far right of the goal curled toward the net, where teammate Nathan stuck out a foot and deflected the ball into the net.
Nathan, an international signing from Brazil playing central defense for the Earthquakes, made a big play in the 21st minute, sliding to deflect a wide open Carlos Vela shot from directly in front of the goal and slowing the ball down enough to be saved.
San Jose made it 2-0 in the 28th minute, when Espinoza made a run into the box, stopped and centered to Lopez for an easy tap-in.
A Yueill own goal gave LAFC life in the 39th minute, but the visitors could not find an equalizer despite several opportunities.
LAFC has gone five games with a win (0-3-2), after starting the month of July with three straight victories.
The Earthquakes have won the past three meetings against LAFC.