Éder Militão and Toni Kroos scored a goal in each half for Madrid, which moved within two points of its Catalan rival entering the World Cup stoppage.
Madrid was coming off its first league loss of the season — a 3-2 defeat at Rayo Vallecano on Monday. It had drawn with Girona at home in the previous round. Madrid’s only other loss of the season came at Leipzig in the group stage of the Champions League last month.
It was a heated match early on at the Santiago Bernabéu Stadium, with Vinícius Júnior and Rodrygo getting into altercations with Cádiz’s players.
Madrid coach Carlo Ancelotti was again without Ballon d’Or winner Karim Benzema because of muscle fatigue.
Militão opened the scoring with a header after a well-placed cross by Kroos in the 40th, and the German midfielder added to Madrid’s lead with a superb one-timer from the outside the area in the 70th.
Lucas Perez moved Cádiz closer with a shot from inside the area in the 81st, and the visitors nearly equalised with a stoppage-time header by Pacha Espino that missed wide.
Madrid had won only one of its last four league matches against Cádiz, which has won only one of its last eight matches and sits in second-to-last in the 20-team standings, one point from safety.
Sevilla and last-place Elche are the other two teams in the relegation zone going into the World Cup break. At the top, Real Sociedad was third, Athletic Bilbao fourth and Atlético Madrid fifth.
VALENCIA WINS AGAIN
Valencia defeated 10-man Real Betis 3-0 at home to end a five-game winless streak.
André Almeida, Hugo Guillamón and Justin Kluivert scored second-half goals for the team coached by Gennaro Gattuso, which moved to 10th place.
Valencia hadn’t won since a match at Osasuna last month.
Betis, which dropped to sixth, lost defender Edgar González to a second yellow card in the 61st.
Betis had two players sent off in the 1-1 draw against rival Sevilla in the previous round.
Manuel Pellegrini’s team got off to a good start but has only one win in its last five league matches.
RAYO VALLECANO HELD
Rayo Vallecano followed its win against Madrid with a 0-0 draw with Celta Vigo at home, staying in eighth place. It was seeking its fourth consecutive victory.
Celta, winless in seven matches, was just outside the relegation zone, ahead of Sevilla.