The Spanish champions were outplayed in big games at El Sadar, but Jules Kounde put them ahead in first-half injury time.
Chimy Avila looked to have salvaged a deserved point for the visitors in the 76th minute but Alejandro Catena was sent off for pulling down Lewandowski in the box and the Pole converted the penalty.
Elsewhere, Porto scored in the 88th minute to give Girona a 1-0 win over Las Palmas that leaves them second, two points behind Real Madrid, while Mallorca and Athletic Bilbao played out a goalless draw.
Kylian Mbappe scored twice as French champions Paris St Germain won 4-1 over struggling Lyon in Ligue 1.
Achraf Hakimi and Marco Asensio also got on the scoresheet at the Groupama Stadium as PSG piled on the misery for fired-up home manager Laurent Blanc.
The result left Lyon at the bottom of the table with just one point from four games.
They were overtaken by Clermont, who claimed their first point of the season by fighting back from 2-0 down to grab a last-gasp 2-2 draw against Toulouse. Florent Ogier scored their equalizer in injury time.
Metz and Reims also drew 2-2, while Le Havre beat Lorient 3-0, Lille beat Montpellier 1-0 and Nice beat Strasbourg 2-0.
Lautaro Martinez struck twice as Inter Milan moved to the top of Serie A with an emphatic 4-0 win over Fiorentina at the San Siro.
Marcus Thuram and Hakan Calhanoglu with a penalty also got on the scoresheet as Inter maintained their 100 per cent start to the campaign.
Juventus continued their unbeaten start with a 2-0 triumph at Empoli. Danilo and Federico Chiesa scored in each half.
Nemanja Radonjic scored in stoppage time as Torino beat Genoa 1-0 and Lecce beat Salernitana 2-0.
In Germany, Benjamin Sesko scored twice in the last five minutes to wrap up RB Leipzig’s 3-0 win over 10-man Union Berlin.
Xavi Simons opened the scoring after 51 minutes and the Union’s hopes of getting back into the game were dealt a blow when Kevin Volland was sent off just after the hour mark.
Niels Nkounkou struck in the 87th minute to cancel out Florian Kainz’s penalty and earn Eintracht Frankfurt a 1-1 draw at home to Cologne.