The Black Cats twice fought their way back to within a goal of the visitors.
Leeds play first game since sacking manager Jesse Marsch as Man Utd look to reignite title challenge
Goals from Vinicius Junior, Federico Valverde, Rodrygo and Sergio Arribas sealed the win at the Prince Moulay Abdellah Stadium in Rabat. Ali Maaloul's spot-kick briefly made Madrid sweat but they reached Saturday's final - where they face Al Hilal - and could even afford Luka Modric's late penalty miss. Hussein El Shahat tested Andriy Lunin - in for the injured Thibaut Courtois - but Madrid grabbed the lead through Vinicius.