The Argentine overcame his recent penalty yips to open the scoring from the spot and then headed in his side’s second from Ivan Rakitic’s corner.
Madrid have the chance to reduce the gap back to a point ahead of next weekend’s El Clasico between the two sides when they face Levante on Sunday.
Champions Atletico Madrid are now nine points off the top, though, as they had Miranda sent-off in a 0-0 draw at Espanyol.
Barca boss Luis Enrique made seven changes with Wednesday’s meeting with Manchester City in the Champions League, as well as the Clasico, in mind.
And it took the Catalans half an hour to break down Eibar’s well-organised defence with a sweeping move that led to Borja Ekiza handling a shot from Messi.
The four-time World Player of the Year had missed five of his last 11 penalties for club and country, but made no mistake from the spot as he thumped the ball home left-footed.
Barca could have been further ahead at the break as Luis Suarez fired just off target from Rakitic’s chested pass.
Neymar was then denied from a narrow angle by Jaime Jimenez after a lovely through ball by Messi.
But it was to be Messi himself who put the game beyond any doubt in usual circumstances as he was left free inside the area to head Rakitic’s cross into the far corner and move two goals clear of Cristiano Ronaldo in the fight to be La Liga’s top goalscorer.
Enrique then replaced Neymar and Rakitic with Pedro Rodriguez and Xavi Hernandez, the latter making his 750th appearance for the club.
However, it was Eibar who came closest to scoring in the final quarter when Federico Piovaccari hit the bar in stoppage time.
Atletico remain in fourth, a point behind third-placed Valencia, as they had to settle for a 0-0 draw at Espanyol after Miranda saw red in first-half stoppage time for an elbow on Abraham.
Despite being a man light, Atletico still created the better chances after the break and were desperately unlucky when referee Inaki Vicandi Garrido ruled out Antoine Griezmann’s sweetly struck volley from Diego Godin’s knock-down for an apparent push by the Uruguayan.
Raul Garcia then had the best chance of the match 12 minutes from time when he was played in by Griezmann, but Kiko Casilla made a brilliant save low to his right to deny the Spanish international.
Atletico’s attention now turns to overcoming a 1-0 first leg deficit when they host Bayer Leverkusen in the Champions League on Tuesday.