Diego Simeone's side created some decent openings in either half but it was not until Matheus Cunha prodded the ball home in the 68th minute that it finally broke through.
However, Franco Russo rose above substitute Mario Hermoso to head home an equaliser with 10 minutes remaining, setting up a tense finale.
Kubo, a second-half substitute, who is on loan from Atleti's rival Real Madrid, then raced away on the break in the 91st minute and slid a cool finish under Jan Oblak to seal a surprise victory for Mallorca.
Hermoso replaced Stefan Savic because of an apparent hamstring injury in the 11th minute to the latter, and Atleti was denied an opener shortly after when Angel Correa's volley from six yards was blocked by the chest of Jaume Costa.
Renan Lodi was unable to beat Manolo Reina in a one-on-one situation and Mallorca started to become more adventurous, Lee Kang-in seeing a powerful drive pushed away from the top-right corner by Oblak after the half-hour mark.
The deadlock was finally broken when Cunha scuffed Correa's cross into the air but volleyed it in while prone on the floor, with Russo's header coming after the ball had crossed the line.
However, Russo did end up making a telling impact with his head, steering Lee's free-kick into the bottom-left corner.
Kubo then struck the decisive blow in added time, with Joao Felix blazing a glorious chance to equalise over from inside the six-yard box before the final whistle.