The visiting side winded the newly promoted team with three goals in the opening 18 minutes as Deportivo were left chasing shadows at a packed Estadio Riazor.
Jordi Alba raced onto Cesc Fabregas's pass on three minutes to give Barca the lead before Christian Tello accepted a lovely pass from Messi to drive a shot through the legs of Depor goalkeeper Daniel Aranzubía four minutes later.
Barca seemed to be out of sight when Messi buried the ball high into the net to put his side three goals clear on 18 minutes.
But Deportivo mounted a rousing recovery aided by some slipshod defending. Pizzi converted a penalty on 26 minutes after Javier Mascherano brought down Riki.
Alex Bergantiños then walloped a shot at goal from the edge of the box on 37 minutes that somehow crept under the body of the shoddy Victor Valdes.
Deportivo were suddenly right back in the match, but Messi quelled the home side's fans when he darted onto a ball from Fabregas to bury the ball into the corner of the net two minutes before the break.
Deportivo weren't finished as Pizzi sent a wonderful free-kick crashing high into the corner of the net on 47 minutes. And their hopes were further boosted when Mascherano was sent off moments later for a second yellow card even though he seemed to make minimal contact competing for a loose ball with Riki.
Messi had saw a free-kick crash off a post in the second half, but there was no stopping the little Argentina player as he darted from just inside the home half to the edge of the box before sending a shot spinning into the corner of the net to hand Barca a 5-3 advantage on 77 minutes.
But Depor set up a nervy finish when Alba somehow managed to lob Alves on 79 minutes in trying to clear the ball. Depor sent their keeper up for a corner in the closing moments, but could not find the equaliser.
Barca have 22 points from eight games with nearest rivals Atletico Madrid - three points behind - visiting Real Sociedad on Sunday evening.
The last time that Barcelona won a league game conceding four goals was in 1963 against Levante. This was a close run thing.
- Cesc Fabregas