Pep Guardiola’s side were 3-0 to the good at half time thanks to an own goal from Aliaksandr Volodko and further strikes from Pedro Rodriguez and Messi.
The Argentina international grabbed the fourth goal early in the second half with an assured left-footed finish to move level with Ladislau Kubala’s Barca total of 194, before David Villa rounded things off as the visitors made light of the sodden conditions.
AC Milan had to work hard to dispatch Viktoria Plzen at the San Siro, waiting until the 53rd minute until Zlatan Ibrahimovic finally broke the deadlock from the penalty spot.
Massimiliano Allegri’s men, who have struggled to make an impact in Serie A so far with five points from four games, put the points beyond doubt when Antonio Cassano netted the second in the 66th minute, as the Italians keep pace with Barcelona.
Marseille moved clear of Arsenal at the top of Group F with their second win in as many games as they eased past Borussia Dortmund 3-0.
Andre Ayew gave the home team the lead in the 20th minute. Loic Remy added a second against the run of play in the 62nd minute before a penalty from Ayew wrapped up the win for Didier Deschamps’ men.
Marseille now top Group F from Arsenal.
In Chelsea’s Group E, Bayer Leverkusen claimed their first points in this season’s Champions League when Lars Bender and Michael Ballack guided the Bundesliga side to a 2-0 victory in a thrilling clash with Genk.
The three points were only sealed in injury-time when former Chelsea midfielder Ballack volleyed home from the edge of the area for his 16th career Champions League goal.
Bender had given Leverkusen the lead in the 29th minute when he drilled the ball home from an acute angle but in a pulsating game, both sides created plenty of chances. Cork referee Alan Kelly officiated the game in Germany.
In Group G, Shakhtar Donetsk’s disappointing start to the Champions League group stage continued as they were held to a 1-1 draw by unfancied APOEL Nicosia.
Ivan Trickovski’s goal just after an hour looked as if it might give the Cypriot visitors a smash-and-grab victory but their lead lasted just three minutes before Jadson levelled with a sweet volley.
Earlier, Russian champions Zenit St Petersburg picked up their first points of this season’s Champions League with a comfortable 3-1 win over outside fancies Porto.
James Rodriquez put Porto ahead but Roman Shirokov levelled matters not long after Porto’s ninth-minute opener.
Shirokov completed a brace and Danny added a third after Jorge Fucile was sent off for the Portuguese just before half time.