The victory came despite coach Zinedine Zidane making a string of changes in defence.
Karim Benzema put Real ahead in the 31st minute while appearing to be offside in the build-up to the goal, but Alaves still caused the leaders a few headaches before goals from Isco and Nacho in the 85th and 88th minutes sealed the points.
Sevilla slipped out of the top three after being held to a 0-0 draw at home to struggling Sporting Gijon in the early game.
Real were dealt an early setback when Raphael Varane had to go off with a hamstring problem in the 11th minute which forced Zidane to rejig his defence, moving Nacho to centre back and switching Danilo from right back to left back to accommodate substitute Dani Carvajal, who set up the breakthrough goal.
Carvajal received a pass from Benzema on the right and cut inside to send the ball bouncing back to the Frenchman, who lashed it into the net.
Zidane had rested goalkeeper Keylor Navas, captain Sergio Ramos and Marcelo, and was missing Casemiro through suspension, but opted for a highly attacking formation, starting playmaker Isco in the midfield three behind his first-choice attacking trio of Gareth Bale, Benzema and Cristiano Ronaldo.
Alaves spurned two clear chances to level in the second half before Isco killed off their hopes by smashing home a perfectly weighted pass from Ronaldo on the counter, while Nacho bundled in the third goal moments later, pouncing after Bale had smacked the crossbar from a free-kick.
Real top the standings on 68 points after 28 games, although champions
Real will then have an extra game in hand against Celta Vigo, due to be played in May.
Sevilla find themselves outside the top three for the first time since November after being held goalless by relegation-threatened Sporting Gijon, with the hosts dropping points for the fourth consecutive league game.
Sevilla slide to fourth spot on 58 points, level with Atletico
Sevilla have surrendered a nine-point lead over Atletico in the space of four games.