The laboured victory at Espanyol's Cornella-El Prat stadium lifted the champions, who are chasing a fifth domestic league triumph in six years, above Atletico into first place on 75 points from 31 matches.
Atletico have 73 in second and can reclaim top spot with a win at fourth-placed Athletic Bilbao later on Saturday. Real are three points further back in third after two consecutive defeats and host city neighbours Rayo Vallecano.
Barca and Espanyol each had chances in a frenetic opening with Messi and Neymar going close for the visitors and Pizzi wasting two excellent opportunities for the home side.
The decisive moment of the match came when Espanyol fullback Javi Lopez handled the ball in the area and Messi dispatched the spot kick with 13 minutes remaining, the Argentina forward's 23rd La Liga goal of an injury-disrupted season.
Espanyol goalkeeper Kiko Casilla was shown a straight red card seven minutes from time when he sprinted out of his area and handled an attempted Messi lob.
Lopez had to replace Casilla in goal as Espanyol had used their three substitutes and did well to divert an effort from substitute Alexis Sanchez away for a corner in added time.
Image: Lionel Messi
Photograph: Alex Caparros/Getty Images
Sports Shorts: Heena bags silver; Winning trumps style for Brazilians
PHOTOS: How Messi's 'trick' took Barcelona past Real Madrid
Sports shorts: Tendulkar to be 'main attraction' at Bahrain GP
La Liga: Ronaldo winner for Real, Costa delights Atletico
PHOTOS: Messi, Suarez and other Latin Americans light up Europe