La Liga Wrap: Messi inspires derby demolition
Luis Enrique's men were made to pay for a sloppy start as Barca academy product Sergio Garcia gave the visitors an early lead, but the hosts eventually found their stride and La Liga's record goalscorer Messi added another hat-trick to his record.
Espanyol had not scored at their city rivals since another La Masia graduate, Ivan de la Pena, netted twice in a 2-1 win back in February 2009.
But Garcia ended that five-match drought after just 13 minutes and Sergio Gonzalez's men continued to threaten on the counter-attack.
Barca finally restored parity just before the break, however, as Messi bent a fine strike past Kiko Casilla and he completed the turnaround early in the second period, with Gerard Pique adding a third shortly after.
Espanyol never posed any threat of a comeback of their own, and Pedro got his name on the scoresheet with 13 minutes left before Messi subsequently completed his hat-trick soon after, ensuring Barca close back to within two points of pacesetters Real Madrid.
Moyes' honeymoon at Real Sociedad came to an abrupt end at Villarreal on Sunday, as Marcelino Garcia Toral's side ran out comfortable 4-0 winners at El Madrigal.
Real held firm until half-time but after Bruno Soriano's 63rd-minute opener, the visitors collapsed and Villarreal romped to an easy win.
Denis Cheryshev added the second ten minutes later and second-half substitute Moi Gomez completed the scoring with a double in the final stages, lifting Marcelino's side up to sixth.
Villarreal remain six points off the UEFA Champions League spots though, as Marcelino's former team Sevilla claimed a 1-0 win at Rayo Vallecano courtesy of Carlos Bacca's 10th Liga goal of the season, consolidating the Europa League holders' place in fourth.
In the day's late kick-off, Valencia saw themselves slip four points behind Sevilla as they could only draw 1-1 at Granada, their fourth consecutive league match without a win.
Isaac Success's 89th-minute equaliser rescued a point for the hosts just a few moments after Alvaro Negredo had seemingly given Nuno Espirito Santo's men the victory, with a Paco Alcacer red card sandwiched between the two incidents spurring Granada on.