Mata scored from the spot in the 56th minute after Frenkie de Jong was adjudged to have fouled Djene Dakonam in the area.
Djene hit his own bar in stoppage time as Barca pushed for an equaliser but the home side held on to record a memorable win at the Coliseum Alfonso Perez.
Despite the loss, two teenagers did well on their full debuts for Barcelona. Pedri, 17, was one of the brighter lights in the first half, while United States international Sergino Dest, 19, slotted in seamlessly at left-back.
The positives gleaned from three unbeaten games before the international break were all lost at Getafe, as Barca's weaknesses were laid bare. They were unable to match Getafe physically and lacked a Plan B. David Soria had very little to do in the home side's goal.
Ousmane Dembele didn't deliver on his first start -- although he deserves more time after a long injury layoff -- and Antoine Griezmann, under pressure to deliver, missed the first half's best chance.
The loss will irk coach Ronald Koeman even more given they failed to capitalise on Real Madrid's loss to Cadiz earlier in the day ahead of next weekend's Clasico at Camp Nou.
Manager rating out of 10
5 -- Koeman's Barca tenure had started quite well but we will see what he's made of after his first defeat. He seems to have no plan other than 4-2-3-1 and his attempts to change the game just involved chucking attackers on and trying to chuck the ball into the box. There was no ingenuity.
Player ratings (1-10; 10 = best, players introduced after 70 minutes get no rating)
GK Neto, 7 -- The busier of the two goalkeepers. Couldn't be expected to save the penalty but did make a couple of smart stops to keep Barça in the game.
DF Gerard Pique, 6 -- Getafe's only goal came from a penalty. Barca's problem was in the final third, not at the back.
DF Clement Lenglet, 6 -- Like Pique, didn't do a lot wrong against a physical Getafe side.
DF Sergino Dest, 7 -- A decent full debut at left-back, filling in for the injured Jordi Alba. Showed more than enough to suggest he will fit in very quickly.
MF Sergio Busquets, 6 -- Often exposed in the second half as the lone midfielder once De Jong went off but did OK.
MF Frenkie de Jong, 6 -- Unlucky to give the penalty away but still searching for his best form.
FW Antoine Griezmann, 5 -- Fired over when clean through in the first half and remains without a goal for Barca this season.
FW Pedri, 7 -- Still not even 18 but playing like a 25-year-old. Happy to glide with the ball, drop between the lines and has an eye for a pass -- as displayed with his assist for the Griezmann chance.
FW Ousmane Dembele, 5 -- Lost the ball too many times in the first half. Made a couple of encouraging runs after the break but was soon taken off once Getafe took the lead.
FW Lionel Messi, 6 -- Even on one of his quieter nights he still managed to hit the post in the first half and stab one final shot wide in stoppage time.
FW Philippe Coutinho, 6 -- Came on to change the game but struggled to find space against a compact opponent.
FW Martin Braithwaite, N/R -- Given very little time to make his mark. Forced Djene to head against his own bar late on.
FW Francisco Trincao, N/R -- Came on too late to have an effect but still found time for one comically bad pass.
MF Riqui Puig, N/R -- Thrown on in the 86th minute for Sergi Roberto.