Knockout-phase debutants City matched Barcelona in the first half at the Etihad Stadium, but the game changed early in the second period when Martin Demichelis was sent off following a last-man foul on Messi.
The Argentine scored from the ensuing penalty in the 54th minute, taking his tally of goals in this season’s competition to seven.
Despite being a man down, City continued to threaten, but in the final minute Alves ran through to score, leaving Barcelona firmly in the driving seat ahead of the return leg on March 12.
While Neymar started on the bench for Barcelona after his recent return from injury, City manager Manuel Pellegrini deployed a pragmatic 4-4-1-1 formation, with Alvaro Negredo playing as a lone striker.
Both managers had emphasised the importance of possession before the game and in that domain the visitors quickly stamped their authority, immediately trading passes with their usual hypnotic fluidity.
There was no penetration to their passing, however, and when City began to probe, they found fissures in the Barca defence.
A pass from David Silva freed Negredo, who eluded Gerard Pique before lifting the ball over Victor Valdes from a tight angle, but there were no City players up in support.
Barca goalkeeper Valdes was then given a moment of discomfort when Vincent Kompany got his head to a free-kick from Silva, sparking a goalmouth scramble that was cut short when Negredo was penalised for an infringement.
Negredo hit a snapshot straight at Valdes, before Barca came to life, with Messi firing over from the edge of the box and Xavi extending City goalkeeper Joe Hart with a rasping 25-yard drive.
It was an encouraging first half for the home side, but eight minutes into the second period the balance of the tie suddenly shifted in Barcelona’s favour.
Andres Iniesta’s pass put Messi through on goal and Demichelis, sliding in from behind, brought the Argentine down.
The offence occurred right on the edge of the box, but referee Jonas Eriksson awarded a penalty and after Demichelis had trudged off, Messi planted the spot-kick past Hart.
Pellegrini sent on Joleon Lescott and Samir Nasri in place of Aleksandar Kolarov and Jesus Navas, and Nasri quickly had a sight of goal, only for Pique to block.
Alves teed up Xavi to shoot over and then drilled narrowly wide after a one-two with Alexis Sanchez as Barca threatened to twist the knife, while Neymar’s introduction seemed to presage further bad news for City.
Instead, the hosts continued to push, with Valdes plunging to his right to repel a volley from Silva in the 77th minute.
Barca had the final say, however, with Alves gathering a pass from Neymar and tucking the ball between Hart’s legs in the final minute to further tighten the Catalans’ grip on the tie.