Naples has been in mourning this week following the death of Maradona and reminders of the great Argentinian were everywhere at the San Paolo on Sunday.
He was remembered before the game and in the 10th minute, when his image was shown on the stadium screens in celebration of the famous number 10 shirt he wore.
The Napoli team, meanwhile, wore a special blue-and-white-striped shirt designed to echo the close bond between the club, Maradona and Argentina.
Roma's defeat means AC Milan lead the table by five points after a 2-0 victory over Fiorentina.
Alessio Romagnoli opened the scoring in the 17th minute and Franck Kessie added the second from the penalty spot 10 minutes later.
Lazio were beaten 3-1 at home by Udinese while Bologna defeated bottom side Crotone 1-0 and Cagliari and Spezia played out a 2-2 draw.
In Barca's first home game since the death of their former player, Messi celebrated his 73rd-minute goal by taking off his shirt to reveal the number 10 jersey of his youth team, Newell's Old Boys, in tribute to his fellow Argentinian, who represented the same club towards the latter stages of his career.
Martin Braithwaite opened the scoring just before the half-hour mark, with Antoine Griezmann doubling Barca's advantage with a stunning volley shortly before half-time. Philippe Coutinho made it three on 57 minutes before Messi sealed matters.
Leaders Real Sociedad and third-placed Villarreal played out a 1-1 draw in San Sebastian, with both goals coming from the penalty spot.
At the bottom of the table Celta Vigo scored a valuable 3-1 win over Granada, while Getafe and Athletic Bilbao drew 1-1.
Lyon, Monaco and Montpellier all closed to within two points of Ligue 1 leaders Paris St Germain.
Lyon and Monaco both claimed 3-0 victories over sides reduced to 10 men, the former seeing off Reims while the latter defeated Nimes.
Montpellier needed Petar Skuletic's 79th-minute strike for a 1-0 victory away at Lorient.
Lille made it a four-way tie on 23 points by coming from behind to draw 1-1 with St Etienne.
Other results saw Angers win 3-1 at Lens, bottom side Dijon upset Nice by the same scoreline and Metz lose 2-0 at home to Metz.
In the Bundesliga, Bayer Leverkusen dropped two points when they were held to a goalless draw by Hertha Berlin, while Mainz and Hoffenheim played out a 1-1 draw.