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 of 38 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 straight defeats and host city neighbours Rayo Vallecano.
Barca's trip across town to face their local rivals, who are eighth on 40 points and still in with a chance of qualifying for Europe, was potentially their stiffest test remaining before their final game at home to Atletico in May.
While they were far from their dynamic best against a well-drilled and fired-up Espanyol side, the victory was a positive way to prepare for Tuesday's Champions League quarter-final, first leg at home to Atletico.
"We are now in a privileged position (in La Liga) and we are in charge of our own destiny," Barca midfielder Sergio Busquets said in an interview with Spanish TV broadcaster Canal Plus.
"Let's hope that is the case until the last game against Atletico," added the Spain international.
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.


Latest News from Sports News Desk