Veteran forward Lewandowski scored a brilliant header early in the second half and thrashed home a penalty in the 77th minute to reach seven league goals.
Barcelona trio Robert Lewandowski, Jules Kounde and Raphinha are fit to face Real Madrid in the Clasico on Saturday
Barcelona coach Xavi Hernandez praised his side's "winning character" after a sensational 3-2 comeback to beat Celta Vigo on Saturday and move top of La Liga, ahead of Monday's Madrid derby.
Barcelona took the lead through Jules Kounde's header in the first half but Chimy Avila drilled the hosts level with less than 15 minutes remaining.
Leandro Trossard bagged a second-half brace as Arsenal twice came from behind to defeat Spanish champions Barcelona 5-3 in a pre-season friendly in Los Angeles on Wednesday.
Robert Lewandowski struck twice for Barcelona, along with goals for Alejandro Balde and Jules Kounde, while Javi Puado and Joselu pulled two back late on for the hosts.
Barcelona striker Robert Lewandowski would love Lionel Messi to return to the Catalan club from Paris Saint-Germain this summer, he said on Tuesday.
Real Madrid face Barcelona in the first leg of the Copa Del Rey semi-final tie at the Estadio Santiago Bernabeu on Friday
A wounded Barcelona face Real Madrid in the Copa del Rey semi-final first leg on Thursday hunting for a Clasico win to make coach Xavi Hernandez's gamble at a critical moment of the season pay off
La Liga leaders Barcelona tumbled to an embarrassing 1-0 defeat at Almeria on Sunday, failing to capitalise on Real Madrid's derby draw with Atletico to extend their advantage