Messi scored on his hands and knees and later won a penalty to lead the Blaugrana to a 3-1 win at the Camp Nou. Barcelona progressed 4-2 on aggregate.
Napoli attempted an unlikely comeback in the second half but ultimately fell short. Substitute Arkadiusz Milik headed home from an offside position, and Hirving Lozano's header hit the side of goalkeeper Marc-Andre ter Stegen's post.
Barcelona will now travel to Lisbon to face Bayern in a one-off quarterfinal tie on Aug. 14.
Napoli controlled more possession, completed more passes, and fired more shots than Barcelona, but their only goal came from the penalty spot. Lorenzo Insigne converted in first-half stoppage time to give Gennaro Gattuso's side hope, albeit temporarily.
Clement Lenglet opened the scoring in the 10th minute with a leaping header that drew some scrutiny from the Video Assistant Referee. The Frenchman pushed off Diego Demme before connecting with the corner kick, but the goal ultimately stood.
Then, Messi took over. Slaloming through the final third, the undersized Argentine beat four defenders and hooked a shot past the outstretched David Ospina. He would've scored another if the Video Assistant Referee hadn't spotted a handball on another close-range attempt in the first half.
Messi drew a penalty off Kalidou Koulibaly - who unwittingly caught the 33-year-old in the leg while attempting to clear - and Luis Suarez converted. Despite sporting a noticeable limp, Barcelona's captain went on to play the full 90 minutes.