Messi's PSG will take on German giants Bayern Munich.
The defeat was another blow to Barca and manager Xavi Hernandez after they were left on the brink of Champions League elimination following a draw with Inter Milan last week.
Real Madrid are level with rivals Barcelona on 19 points at the top of standings, with Barca ahead on goal difference.
The Polish striker secured Barca's points in the 20th minute when he sped into the area, made a brilliant cut inside to clear a defender and slotted the ball to the goalkeeper's left.
Victory means Real return to the top of the LaLiga table on 18 points from six games, two ahead of Barcelona in second.
Real returned to the top of La Liga table after their 4-1 victory.
Lewandowski, who came on as a substitute after the goal, continued his fine start to life in Spain with Barca's second 25 minutes from time to put the visitors in command.
The 3-0 win win over Sevilla lifts Barcelona to second place in the table on 10 points, two behind leaders Real Madrid who beat Real Betis 2-1.
Real Madrid sit top of the table on nine points, level with Real Betis. Barcelona and Villarreal are right behind on seven points, with Osasuna and Real Sociedad on six.
Real Madrid manager Carlo Ancelotti won the best coach award.