Blaugrana skipper Messi had missed Argentina's midweek friendly with Moroccoand revealed he has been managing a pelvic injury since December, but he was available for LaLiga action and typically netted both goals.
The forward carried Barca's chief threat as he moved past Andres Iniesta into second place on the club's all-time appearance list, yet he may not have broken the deadlock had Sanchez not foolishly directed a 71st-minute free-kick into his own net.
That mistake cost Espanyol a battling draw as goalkeeper Diego Lopez excelled, with Messi sealing the points late on as he doubled the league leaders' advantage.
There was no hint at Messi's ongoing fitness problems as he dazzled from the outset, seeing one close-range effort superbly blocked by Naldo before prompting an attack that concluded with Ivan Rakitic fizzing a shot just wide.
Messi's inswinging free-kick was then almost deflected past Lopez on the 30-minute mark - drawing a smart stop - while Barcelona supporters shared confused glances when the Argentina international uncharacteristically missed the target as his one-man assault on Espanyol's goal continued.
Barca were dismayed by a couple of refereeing calls early in the second half, with Nelson Semedo denied a penalty, and Lopez again foiled the hosts as substitute Malcom's rising strike was expertly palmed clear.
However, Sanchez's moment of madness saw the Espanyol skipper dive in on Messi just outside the box and then, as the Barca number 10 stepped up, dart back to the goal-line and beat Lopez to the free-kick, awkwardly flicking a header beyond the goalkeeper, who looked to have the strike covered.
A low sweeping finish a minute from the end of normal time saw Messi double his and Barca's tally and make the victory safe, taking another step towards the title.
Messidependencia evident
Messi, one of the greatest players of all time, is always likely to be at the forefront of Barcelona's best work. But in the week he revealed concerns about his fitness ahead of a key stretch of the season, this Blaugrana performance was a little too one-dimensional. Messi can cut through any side, yet an enforced absence would give his side real problems.
Predictable brilliance
Even if Sanchez contributed to the opener, it always looked like Messi would be the man to make the difference. On a day when Luis Suarez and Philippe Coutinho failed to fire, their front-line partner was involved in everything from the moment he sent a defender to the floor and the crowd to their feet with a devastating piece of close control in the opening minutes.