Barcelona opened the scoring thanks to an incisive pass from Gundogan to Lewandowski and the Pole lofted the ball over goalkeeper Antonio Sivera to score his ninth goal of the season.
Gundogan popped up early in the second half with a fine left-foot strike from Pedri‘s pass to increase Barcelona’s lead.
Alavés launched a quick counter-attack two minutes later following a breakaway by Alex Sola who crossed for Samu Omorodion to head home.
“We knew how to compete and we were very solid at the back. The pity is that goal we conceded, because we had the game under control at 2-0 and within minutes they scored. We defended the box badly and that makes me angry, because we worked hard,” said Barça coach Xavi Hernandez.
“But overall we played a very good and very mature game,” added the coach in his second game after last week’s announcement of his departure at the end of the season.
“We have two victories after that decision, I said it was necessary and here is the reaction of the team. We have been very effective, something we had lacked all season. It’s an important victory.”
Barcelona increased their lead thanks to a shot from Roque, who had replaced Gundogan in the 63rd minute.
“We are going to appeal the sending off of Vitor Roque. It is clear that it is a mistake, another one against us. Robert [Lewandowski] is our goalscorer and today he played a great game and Vitor too, he gives us goals and I think the sending-off was very unfair,” Xavi added.