Madrid were crowned champions after beating Villarreal 2-1 on Thursday and had nothing to play for in this one as Zidane made several changes.
Eder Militao and Lucas Vazquez both started in defence and Leganes, needing all three points and for Celta Vigo not to win at Espanyol in order to stay up, caused problems for Los Blancos.
Bryan Gil levelled just before half-time as he controlled a cross from the left by Jonathan Silva, took a touch and fired a low shot through the legs of Alphonse Areola, given a rare chance in goal as Thibaut Courtois watched from the bench.
In the second half, Madrid went back in front when Isco threaded a lovely ball through for Marco Asensio and the Spain attacker fired low past Ivan Cuellar.
But again Leganes came back as Roger Assale beat Areola following a cross from the left by Silva with 12 minutes left.
With Celta still goalless at Espanyol, Javier Aguirre’s side went for it in the closing stages and the game opened up. Javier Aviles missed two good chances and Oscar Rodriguez fired over deep into added time.
In the end, it was not enough and Leganes are relegated despite a brave fight. They finish 18th as Madrid end on 87 points, five ahead of second-placed Barcelona.
Relive the action as it happened with Standard Sport!
Can't see the live blog? Click here to view our desktop version.