Relegation strugglers Granada were leading through Ruben Rochina's strike, but the unlucky Lopes turned the ball into his own net eight minutes from full-time.
David Barral was shown a second yellow card for a forearm to the face of Gerard Moreno after just 28 minutes yet the hosts grabbed an unlikely lead through captain Rochina five minutes before half-time.
Espanyol were twice guilty of not playing to the whistle, first when they felt Ruben Duarte had been fouled by Isaac Success.
Success briefly paused to protest his innocence, but then realised he had not been penalised. The winger collected the ball and ran into the penalty area, where his shot was deflected into the path of Rochina.
Espanyol then appealed for offside, but Rochina was in an onside position when he slammed the ball past Espanyol keeper Pau Lopez.
The visitors pressed for an equaliser with Burgui latching on to Alvaro Gonzalez's pass, only to fire wide from the edge of the box.
Gerard Moreno was off target with a header from Hernan Perez's cross and Gonzalez was gifted a free header from a corner with 10 minutes left but he could only nod the ball wide.
However, in the 82nd minute Perez shaped a low cross into the Granada penalty area and Lopes stuck out a leg to inadvertently divert it past his own goalkeeper Andres Fernandez.