Messi nets second straight hat-trick
The Argentine forward headed the opener after only five minutes at the Romareda, and scored a stunning solo effort for the second in the 65th.
VIDEO: Watch it here
He won the ball in midfield, accelerated past one tackle, turned a defender twice in the area and then fired low into the corner.
He completed his second successive La Liga hat-trick 12 minutes from time, before Zaragoza substitute Adrian Colunga grabbed two late goals for the visitors.
Once again it was Messi who steadied the ship, winning a penalty at the end which an out-of-sorts Zlatan Ibrahimovic scored to put the gloss on a tough encounter.
VIDEO: Watch full highlights here
The champions moved on to 68 points from 27 games, level with Real who beat Sporting Gijon 3-1 on Saturday, but stayed second on goal difference.
"It's a team effort. Everyone works hard and fights hard," Messi told Canal Plus television.
"I might be the one who scores the goals, but it is a result of everyone's work."
Earlier, David Silva set up the first and scored the second as Valencia overcame a stubborn Almeria 2-0 to strengthen their hold on third place with 50 points.
They moved four points clear of Real Mallorca, who moved into Spain's fourth Champions League qualification spot by crushing 10-man Atletico Madrid 4-1.
Improving Almeria were unbeaten in seven when they arrived at the Mestalla, and it took a clever turn and defence-splitting pass from Silva to set up Juan Mata for Valencia's opener in the 63rd minute.
The Spain midfielder then grabbed the second soon after, scoring despite lying on the ground in the area after being tackled.
Cash-strapped Mallorca, who have won all but one of their home games this season, took the lead through Victor after only 10 minutes against Atletico but Diego Forlan levelled for the King's Cup finalists in the 25th.
Aritz Aduriz restored Mallorca's advantage almost immediately and Atletico faded after midfielder Raul Garcia was sent off early in the second half.
Luis Perea sliced the ball into his own net at a corner and then Felipe Mattioni volleyed a spectacular fourth for the islanders in the last minute.
"This win makes a point to all those rivals who thought off-field problems would take their toll on us," Mallorca coach Gregorio Manzano told reporters.
"Today we have proved we are a strong, ambitious team and worthy candidates for the European places."
Mallorca moved on to 46 points, two above Sevilla.