The Spanish champions were already 3-0 up thanks to Luis Suarez and a double from Rafinha when Messi was introduced after nearly a month out with a groin problem just before the hour mark and wasted no time in scoring his ninth goal of the season.
Barca trail league leaders Sevilla by a point after the Andalusians won away from home in La Liga for the first time in 23 games, triumphing 3-2 at Leganes.
Atletico Madrid and Real Madrid can move back to the top of the table when they face Granada and Real Betis respectively later on Saturday.
Barca have traditionally struggled on weekends following international breaks and fell to a shock 2-1 defeat at home to Alaves on their return to action in September.
Deportivo had also drawn 2-2 on their last two visits to the Camp Nou, but never threatened another upset as Barca got back to winning ways after losing 4-3 to Celta Vigo two weeks ago.
Neymar smashed a volley against the bar and Suarez somehow headed the rebound over early on.
However, Barca had to wait just 21 minutes to open the scoring when Rafinha exchanged a one-two with Suarez before drilling a low shot that had too much power for German Lux.
Rafinha bundled home a second 15 minutes later after Lux had saved Gerard Pique’s initial effort.
Suarez moved level with Antoine Griezmann as La Liga’s top scorer with six this season when he brilliantly turned away from the Deportivo defence when receiving Neymar’s through ball before slotting home the third.
The Uruguayan then smacked the post himself on the volley before he was replaced by Paco Alcacer at half-time to keep him fresh for the visit of City on Wednesday.
Messi was next to be introduced from the bench and took just three touches to find the net when he flicked another Neymar assist over the helpless Lux.
Deportivo were reduced to 10 men 25 minutes from time when Laure’s frustration boiled over as he saw red for elbowing Neymar in the face.
Alcacer missed three golden opportunities to register his first Barca goal.
And Lux produced a brilliant flying stop to prevent Messi rounding off his return with a fifth.
Sevilla moved to the top by ending a 17-month wait for an away league win at Leganes.
Franco Vazquez’s opener and a second from the impressive Samir Nasri just before the hour mark put Jorge Sampaoli’s men well on course to end that barren run.
However, their defensive frailties looked set to cost them victory once more as Leganes fought back with two goals in three minutes through David Timor and Alexander Szymanowski.
Pablo Sarabia proved the match winner off the bench, though, when he curled home from outside the area his third goal in just seven La Liga games since joining from Getafe.
AFP PLACE YOUR TEXT ADVERT BELOW:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> How I TOTALLY Got Rid Of my POT BELLY,excess Fat and Overweight In just 2weeks.. Click HERE for Details.