Results ahead of the clash in Madrid had been kind to Barcelona, with second-placed Atletico Madrid and third-placed Sevilla playing out a 1-1 draw at the Estadio Ramon earlier in the day.
Real Madrid, meanwhile, suffered a shock 2-0 home defeat to Real Sociedad, meaning that Barcelona's seven-point lead over their Clasico rivals stood ahead of kickoff against El Geta.
Getafe brought La Liga's joint-best defensive record into the match, however, and had only been beaten in four of their 17 matches to sit in an impressive seventh position.
It was the home side who had the first shot of the match, however, with experienced forward Angel volleying over the crossbar from a central position following smart work from Mata.
Getafe had the ball in the back of the Barcelona net in the ninth minute when Mata volleyed home at the far post, but the referee disallowed the goal with Angel appearing to nudge Gerard Pique to the ground moments before.
The six-minute period that followed brought three yellow cards and a number of late challenges, one of which saw Angel catch Barcelona goalkeeper Marc-Andre ter Stegen with a high boot.
The visitors took the lead in the 20th minute, however, when Messi reacted first to a dropping ball inside the Getafe box before poking it past goalkeeper David Soria and converting from a narrow angle.
Soria had to save from Luis Suarez in the spell of pressure that followed, before the Getafe stopper kept out a close-range Pique effort in excellent fashion.
Luis Suarez came close once again in the 29th minute when his curling effort was deflected wide of the Getafe post during a period of domination from the away side.
Barcelona's second was always likely to arrive before the interval, and it was Luis Suarez who scored it in the 39th minute when the Uruguay international's volley from outside the box flew into the back of the net.
The response from Getafe was strong, however, and Jordi Alba turned against his own post from close range before Angel smashed just over the crossbar moments later.
The hosts had their goal in the 43rd minute when Mata turned home from close range after Angel had expertly guided a deep ball from Antunes into the path of his teammate.
Barcelona had 80% of the possession in the first period, but the contest was delicately poised ahead of a second 45 minutes between two teams in good form.
Angel had a huge chance to level the scores early in the second period when he broke into the Barcelona box, but the forward saw his low effort clip the outside of the post. Soria then had to keep out a strike from Messi down the other end during an open period of the match.
Molina's introduction made a difference and Getafe had a stunning chance to level when Leandro Cabrera rose highest inside the Barcelona box to meet a corner, but Ter Stegen made a wonderful save.
Getafe had another chance to level 20 minutes from time when Mata danced into a shooting position inside the Barcelona box, but the attacker somehow missed the crossbar in front of an open goal.
Messi should have wrapped up the points for Barcelona in the 76th minute when he was sent through by Dembele, but Soria was on hand to make a smart save as the contest remained alive.
As it transpired though, the first-half goals from Messi and Luis Suarez were enough for Barcelona to make it five straight league victories on a night where they moved 10 points clear of fourth-placed Real Madrid.
GETAFE (4-5-1): Soria; Damian, Djene, Cabrera, Antunes; Foulquier (Molina 58'), Arambarri, Maksimovic, Mata, Portillo (Ibanez 84'); Angel (Saiz 74')
BARCELONA (4-3-3): Ter Stegen; Roberto, Pique, Lenglet, Alba; Arthur (Alena 88'), Rakitic (Busquets 70'), Vidal; Messi, L Suarez, Dembele (Coutinho 84')