Messi, meanwhile, bettered his previous record of four against Arsenal two seasons ago and now has 12 goals from seven Champions League matches this season after a majestic attacking performance.
The Argentine legend said: "I'm happy, it's great to score five, but the important thing tonight was the win and to qualify for the quarter-finals.
"We know it's hard for us in the Liga [against Real Madrid], but we want to defend our Champions League title and we are also keeping in our minds the Spanish Cup."
Trailing 3-1 from the first leg it was always going to be a tough task for Bayer with Barca unbeaten in 13 European home games and they never appeared likely to end that run.
Messi struck twice before the break and then hit a further three after the restart while youngster Christian Tello also grabbed a brace.
In the final minute Karim Bellarabi scored for a shell-shocked German side.
"You can expect anything from Leo," said teammate Cesc Fabregas. "He is the best player in history, we have never seen anyone like him.
"He didn't play at the weekend [Messi was suspended] and he wanted to do well. He enjoys being on the pitch and we are happy to have him."
Lyon midfielder Kim Kallstrom was distraught after his side had come off second best in the penalty shoot-out lottery to minnows APOEL.
"It is the worst way to go out," the Swedish international said.
"Over the two games, I think we should have scored more at home."
- AAP