Defender Lopo bagged the game-winner in the 57th minute.
The home side were reduced to 10 men when sub Diego Castro was given a red card in injury time.
Getafe are in sixth place with 22 points. Málaga are in fourth with a record of six wins, four losses and four draws.
Getafe had 13 shots, including three on target.
Getafe had the ball for 41.5% of the match.
Castro made the biggest impact of any Getafe substitute after coming on for Pedro Leon in the 73rd minute, as he took two shots.
The eight shots that Malaga managed were not enough to secure the win.
Miguel Ángel Moyá made five saves.
Malaga completed 357 passes and had 13 crosses in the loss.
Roque Santa Cruz made his mark on the match for Malaga after coming on for Ignacio Camacho in the 66th minute, as he took two shots.
The combination of Jesús Gámez to Portillo was the most common during the match, as the two players connected 13 times.
- Sports & Recreation