The Brazilian striker netted the winner from the spot 13 minutes from time to head La Liga's scoring charts with 19 goals this season, two more than Cristiano Ronaldo.
Atletico go into the winter break with 46 points and a 100 per cent home record. Barcelona, second with 43 points, can draw level with a win at Getafe on Sunday.
Real Madrid, eight points adrift of Atletico, face Valencia on Sunday.
Levante went out with a five-man back line and the clear intention of defending deeply, but they were able to cause Atletico problems going forwards in the opening stages as the home side lacked concentration.
Diego Simeone's side have been a model of consistency so far but they left gaps and failed to pick up their men in defence. Levante made them pay in the first minute, when a pass by Nikolaos Karabelas split the defence and Andreas Ivanschitz fired the ball past keeper Thibaut Courtois.
Moments later Courtois made a fine stop to deny David Barral before Atletico began to threaten. They probed a well-organised Levante rearguard and found a way through in the 30th minute when Diego Godin steered a strong header into the top corner.
Atletico appeared back on track with Costa volleying them in front from a 47th-minute Gabi Fernandez free kick, but as they pushed forward they were exposed defensively with Pedro Rios sprinting clear to make it 2-2 after 55 minutes.
With 13 minutes to go Juanfran Torres was brought down in the box by Ruben Garcia and Costa converted the penalty.
The night got worse for Levante as Juanfran Garcia was given a red card for an altercation with Felipe Luis.
"Diego Costa had a great game, which he demonstrated with the way he took his penalty. The Atletico fans need to praise these players because they deserve it," Atletico coach Simeone told a news conference afterwards.
"There are errors in football and we are not exempt. However, the team had the heart and desire to keep going. It was a historic game for Atletico."
Earlier on Saturday, Sevilla defender Cala scored one and was later sent off as his side made up for a shock King's Cup defeat with a 2-1 victory over Villarreal.
The Andalusian side crashed out of the cup at the hands of lower league Racing Santander on Wednesday but they showed the intensity they were missing in that defeat as Cala headed them in front midway through the first half.
Carlos Bacca slotted home after the break before Cala conceded an 86th-minute penalty and was dismissed. Jeremy Perbet scored from the spot but Sevilla held on to claim a third successive away win.
They are seventh in the league with 26 points, two places and two points behind Villarreal.
(Editing by Stephen Wood)
