The Argentine won it for the first time since 2011, heading off clubmate Luis Suarez and last year's winner Cristiano Ronaldo of Real Madrid after Thursday's group-stage draw.
Barcelona, seeking to win European football's top prize for the sixth time, will take on Italy's Roma, Germany's Bayer Leverkusen and BATE Borisov of Belarus in Group E.
Messi and Ronaldo share the tournament's scoring record on 77 goals.
Ronaldo's Real, which won a long-awaited 10th title in 2014, faces French champion Paris St. Germain -- beaten by Barcelona in last season's quarterfinals.
PSG striker Zlatan Ibrahimovic will have an emotional return to his hometown club Malmo, after getting the draw he had hoped for earlier on Twitter.
"It will be fun for Zlatan to come back home," said the Swedish club's assistant coach Olof Persson.
"It'll be fantastic for the fans to see him and the other stars. I think he will be welcomed the way he always is when he comes home -- like the king of Malmo that he is."
Italian champion Juventus, which lost 3-1 in June's final in Berlin, was drawn in Group D with English club Manchester City, Spain's Sevilla and Borussia Monchengladbach of Germany.
Juve and Roma will be hoping to reach a home final on May 28, to be played at Milan's San Siro stadium.
Chelsea manager Jose Mourinho will face Porto, the Portuguese club where he made his name by winning the tournament in 2004.
Three-time European champion Manchester United, back in the competition after a season's absence, will rate its chances of progressing further after coming through the qualifying round this week.
Louis van Gaal's team faces Dutch champion PSV Eindhoven, from where the former Netherlands coach signed highly-rated international forward Memphis Depay
German runner-up Wolfsburg is also in Group B along with CSKA Moscow -- both clubs also faced United back in the 2009-10 competition.
In Group C, Benfica and Atletico Madrid will face a long trip to Kazakhstan to play Astana -- over 4,250 miles for the Portuguese and Spanish clubs. Galatasaray, meanwhile, has a mere 3,000-mile journey from Istanbul.
Bayern Munich defender Jerome Boateng was happy to be drawn in Group F with English team Arsenal, Greek champion Olympiakos and Croatia's Dinamo Zagreb.
"It could have been worse," the Germany international said on UEFA's website. "We always enjoyed playing against Arsenal, they were tight matches and always very interesting. London has been a good omen for us."
GROUP A: Paris St. Germain, Real Madrid, Shakhtar Donetsk, Malmo.
GROUP B: PSV Eindhoven, Manchester United, CSKA Moscow, Wolfsburg.
GROUP C: Benfica, Atletico Madrid, Galatasaray, Astana.
GROUP D: Juventus, Manchester City, Sevilla, Borussia Monchengladbach.
GROUP E: Barcelona, Bayer Leverkusen, Roma, BATE Borisov.
GROUP F: Bayern Munich, Arsenal, Olympiakos, Dinamo Zagreb.
GROUP G: Chelsea, Porto, Dynamo Kiev, Maccabi Tel-Aviv.
GROUP H: Zenit St. Petersburg, Valencia, Lyon, Gent.
Opening matches played September 15-16.