Lewandowski's ninth strike in the league was enough to seal the victory, but Barça also needed goalkeeper Marc-Andre ter Stegen to be in top form.
The win temporarily takes Barça ahead of Real Madrid at the top of the table.
Barca coach Xavi said: "We have been calm and patient. It is always difficult to attack a 5-4-1, there are few spaces. It has cost us. We've been good in the first half and in the second we've played their game and we can't allow that.
"It costs after national teams and Mallorca is very clear about it. You don't make the 0-2 and it can be complicated for you. The victory today is very important."
On Lewandowski, he added: "All the players I choose to play can make a difference, but he is a top player, one of the best strikers, if not the best. He today he has made a difference again. And how he works he, as he orders, he talks with teammates."