Messi's latest masterclass overshadowed Real Madrid's drab 2-0 triumph at home to promoted Celta Vigo. Gonzalo Higuain and Cristiano Ronaldo (penalty) scored the goals that lifted Jose Mourinho's team to fourth place, eight points behind arch rivals Barca.
World Player of the Year Messi, who is expecting the imminent birth of his first child, has notched 71 goals for club and country in 2012. That leaves him only four short of the record set by Brazilian great Pele in 1959.
The Argentine has 11 goals in eight La Liga outings this season, two more than Ronaldo.
"He [Messi] is off to the hospital now for a happy occasion as his son is on the way," Barca sporting director Andoni Zubizarreta told Spanish television.
Malaga are third on 17 points after Joaquin made amends for fluffing a penalty by grabbing the winner in a 2-1 victory at home to Real Valladolid.
On a day full of late drama, Valencia got their stuttering season back on track when they snatched a 3-2 win over struggling Athletic Bilbao who were leading 2-1 when they had Ander Herrera sent off midway through the second half.
Barca looked to be cruising to a seventh win of the campaign when they raced into a three-goal lead after 18 minutes at Depor's Riazor stadium.
Jordi Alba sped on to a Cesc Fabregas pass to score in the third minute, Cristian Tello added a second and then Messi smashed in his first of the night after Fabregas's clever backheel.
The home side pulled two goals back against the run of play through Pizzi (penalty) and Alex Bergantinos before Messi made the most of another Fabregas assist to make it 4-2 at the break.
In a frenetic start to the second half Depor midfielder Pizzi curled in a stunning 47th-minute free-kick and Mascherano was harshly shown a second yellow card two minutes later.
Barca coach Tito Vilanova reacted by replacing Fabregas with Xavi before Messi, who also struck a free-kick against the post, appeared to have killed the game when he made it 5-3 with a trademark run and clinical finish in the 77th minute.
A bizarre own goal from Barca full-back Jordi Alba, when he lobbed keeper Victor Valdes from inside his own penalty area, gave Depor fresh hope but they were unable to make some late pressure count.
"We could have killed off the game in the first half but Deportivo are strong when they are playing at home and their fans get behind them," said Barca playmaker Andres Iniesta.
"We are going away with the feeling of having got through a tough match and we will learn from that."
Real, who are clawing their way up the table after a poor start to the defence of their title, took an 11th-minute lead at the Bernabeu thanks to a Higuain cross-shot from the left that looped over Celta goalkeeper Sergio and into the net.
The home team struggled to break through Celta's well-drilled defence and needed a 67th-minute Ronaldo penalty, awarded fo
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.