Ajax carried the initiative until Cristiano Ronaldo swung the game in Madrid's favor with his 25th-minute opener at Santiago Bernabeu stadium.
Kaka - making a rare start- doubled Madrid's lead before halftime and set up Karim Benzema to decide the game early in the second half.
Madrid has outscored the Dutch champions 9-0 in three meetings in the last two seasons.
Madrid has six points after two games, while Ajax remains with one.
Also in Group D on Tuesday, Lyon hosted Dinamo Zagreb.