After a low-key start to Saturday's contest, a Saul Niguez header just before the hour mark put the hosts in front.
Joselu scored a stoppage-time penalty for the visitors, but Atletico are now four points clear of Sevilla in fourth and have opened up a superb nine-point cushion over Getafe in fifth.
Jose Maria Gimenez put a free header over from 12 yards and, despite their opponents defending deeply, it was Atletico goalkeeper Jan Oblak who had the only first-half save to make from Aleix Vidal.
Diego Simeone brought on Costa and Llorente early in the second half as he attempted to inject life into the hosts and the latter made an instant impression, winning a free-kick down the right.
Kieran Trippier sent in a fine delivery and the onrushing Saul converted with a thumping header from six yards for his fourth goal of season, keeper Fernando Pacheco getting a hand to it but unable to make the save.
Alaves almost levelled when a powerful aerial effort from Oliver Burke flew inches wide, but Atleti soon threatened at the other end when Llorente's long-range effort forced Pacheco to parry.
Llorente then showed superb pace and skill down the right before drawing a foul from Ruben Duarte, with Costa sending Pacheco the wrong way from the spot 17 minutes from time.
Three minutes into added time, Joselu sent a fine penalty into the top corner after Koke was penalised for handball, but it was too late for the visitors to recover.
What does it mean? Atletico impressing since lockdown
Atletico took the chance to extend their advantage over Sevilla, who could only draw with Real Valladolid on Friday, and now look almost certain to claim a Champions League spot.
They have impressed since LaLiga resumed after the coronavirus-enforced break – having drawn their first game back, they have won four straight games, with only the late spot-kick denying them a fourth straight clean sheet.
Llorente lifts Atletico
Former Real Madrid midfielder Llorente changed the game when he came on, winning the free-kick and penalty that led to each goal, as well as testing Pacheco with a rasping drive.
Correa struggles to make an impact
Angel Correa only had one blocked shot and 10 completed passes to show for his 57 minutes on the pitch, though he was not the only one to blame for a sluggish Atletico start.
Atletico needed points in this match as their next one is a huge test away to Barcelona on Tuesday. Alaves, meanwhile, are at home to Granada a day later as they bid to halt a run of three straight defeats.