The Catalans were playing their first home game since the thrilling 6-1 comeback against Paris Saint-Germain in the Champions League but their performance evoked only a little of the magic of that night.
Valencia exposed their hosts' defensive frailties throughout the first half and Eliaquim Mangala gave Voro Gonzalez's side the lead after 29 minutes.
Fortunately for Barca, their superstar front three were on form and Neymar teed up Luis Suarez to equalise shortly before Mangala conceded a penalty and was sent off, Lionel Messi duly scoring from the spot.
Although Munir El Haddadi drew Valencia level almost immediately against his parent club, the 10 men struggled to contain Messi, who made it 3-2 after 52 minutes but will miss the trip to Granada in the first game back from the international break due to suspension after picking up a late yellow card.
The hosts pressed hard in search of a fourth throughout the closing stages, Neymar's dynamic solo run down the left flank leading to Andre Gomes' 90th-minute settler from close range, as Barca claimed a win that is vital to their title chances, moving them back to within two points of Madrid, who still hold a game in hand over the reigning champions.
In a determined start from the hosts, Suarez tormented Ezequiel Garay, turning his marker with a superb piece of skill before squaring to Messi, whose side-footed shot failed to beat Valencia goalkeeper Diego Alves with 15 minutes played.
The Argentine star hooked a shot over the crossbar moments later following a trademark mazy dribble but Barca lacked urgency and were punished for their slow start in the 29th minute.
After Munir missed a one-on-one with Marc-Andre ter Stegen, Daniel Parejo's corner was met by the head of Mangala, who did well to shake off the attentions of Ivan Rakitic and direct the ball into the corner of the net.
Barca were level six minutes later when Neymar's quick thinking in taking a fast throw-in put Suarez in behind Garay and the Uruguayan picked his spot, side-footing the ball past Alves and in at the far post.
Mangala was given his marching orders for pulling Suarez's shirt in the penalty area, his second booking in the space of five minutes, and Messi drilled the ensuing spot-kick low into the centre of the net to give Barcelona a 2-1 lead.
Undeterred by going a man down, Valencia went straight onto the attack, Jose Gaya bursting clear before squaring to Munir and the loanee was unchallenged as he calmly tucked inside the post to make it 2-2 at half-time.
Neymar had a shot saved by the leg of Alves after six minutes of the second half, but Valencia's Brazilian goalkeeper was beaten at his near post one minute later when Messi burst into the box and scored with his weaker right foot.
Munir caught Barcelona flat-footed once again after 56 minutes but Gerard Pique raced back to make a last-ditch tackle and prevent him from shooting, while at the other end Suarez spurned the chance to make it 4-2, firing wide of an open net after Alves parried Messi's shot right into his path.
Neymar hit the outside of the post with a wonderful, curling free-kick after 76 minutes and the Brazilian star, who was chasing his 100th goal for the club, had to settle for a return to fitness after he missed Barca's previous game against Deportivo La Coruna.
With the game petering out and the visitors showing signs of fatigue, the scene was set for former Valencia player Gomes to score his first Barcelona goal and he did just that, stroking the ball home after Neymar's run and cross to make the final score 4-2.
Key Opta stats:
- Lionel Messi has scored his 100th brace for Barcelona in all competitions.
- Barcelona have won more penalties than any other La Liga side this season in competitions (13).
- Messi is the only LaLiga player to reach 40 goals in each of the last eight seasons in all competitions (41).
- Barcelona have won all of their 17 La Liga games with Samuel Umtiti on the pitch.
- Luis Suarez has scored eight goals in his seven games against Valencia in all competitions.
- Messi has scored more penalty goals against Diego Alves than any other player in LaLiga (100 per cent).
- Neymar has made more assists than any other player this season in all competitions (19 - top five leagues).
- Munir El Haddadi is the only player to score in different La Liga games against Barcelona this season (two goals).
- Eliaquim Mangala is the third player to score and be sent off in the same La Liga game this season, after Zou Feddal and Juanmi.
- Only in 2011-12 (six) Lionel Messi has received more yellow cards than in La Liga this season (five).
- Andre Gomes is the first Portuguese player to score for Barcelona in La Liga since Deco in 2007 (vs Atletico).