Lionel Messi scored twice and missed a penalty as Barcelona came from behind to move within two points of La Liga leaders Atletico Madrid.
Ex-Arsenal man Gabriel headed Valencia in front only for Messi to miss from the spot but convert the rebound.
Antoine Griezmann put Barca ahead and Messi clipped in a trademark free-kick before Carlos Soler’s screamer gave Valencia vain hope.
Barca host leaders Atletico next Saturday at the Nou Camp.
Third-placed Barcelona are level on points with arch rivals Real but beneath them in the table because Real have won both El Clasico games this season.
A shock defeat at home to Granada last time out had left little room for error in Barca’s quest to regain the title.
And Gabriel’s thumping header just after half-time piled further pressure onto Ronald Koeman’s side.
It took a lackadaisical penalty from Messi to spark them into life.
Jasper Cillessen pulled off a tremendous save from Messi’s spot-kick only for the Argentine to pounce for the equaliser in the ensuing scramble.
Frenkie de Jong’s header was then brilliantly turned aside by Cillessen but this time Griezmann was on hand to convert from close range.
Barca’s final goal was vintage Messi, a whipped free-kick that kissed the inside of the post and nestled in the far corner.
It was arguably not the best goal of the night with Soler’s fine strike from distance almost dragging Valencia back into it, but Koeman’s team held on.
- 15GuillamónSubstituted forGameiroat 79′minutes
- 3LatorreBooked at 56minsSubstituted forDiakhabyat 64′minutes
- 19RacicBooked at 35minsSubstituted forOlivaat 79′minutes
- 7Gonçalo Guedes
- 6Reis Ferreira
- 21Vallejo Galván
- 1ter StegenBooked at 65mins
- 2DestSubstituted forRobertoat 75′minutes
- 21de Jong
- 16GonzálezSubstituted forKourouma Kouroumaat 74′minutes
- 13Murara Neto
- 17Machado Trincão
- 19Fernandes Siqueira
- 27Kourouma Kourouma
- José María Sánchez Martínez
Match ends, Valencia 2, Barcelona 3.
Second Half ends, Valencia 2, Barcelona 3.
Foul by Lionel Messi (Barcelona).
Gabriel Paulista (Valencia) wins a free kick in the defensive half.
Attempt missed. Christian Oliva (Valencia) right footed shot from outside the box is high and wide to the right.
Attempt blocked. Kevin Gameiro (Valencia) right footed shot from outside the box is blocked. Assisted by Thierry Correia.
Goal! Valencia 2, Barcelona 3. Carlos Soler (Valencia) right footed shot from outside the box to the top left corner. Assisted by Christian Oliva.
Attempt missed. Jordi Alba (Barcelona) left footed shot from outside the box misses to the right.
Attempt blocked. Lionel Messi (Barcelona) left footed shot from the centre of the box is blocked.
Offside, Valencia. Gonçalo Guedes tries a through ball, but Kevin Gameiro is caught offside.
Substitution, Valencia. Kevin Gameiro replaces Hugo Guillamón.
Substitution, Valencia. Christian Oliva replaces Uros Racic.
Ilaix Moriba (Barcelona) wins a free kick in the defensive half.
Foul by Gabriel Paulista (Valencia).
Foul by Jordi Alba (Barcelona).
Thierry Correia (Valencia) wins a free kick in the defensive half.
Substitution, Barcelona. Sergi Roberto replaces Sergiño Dest.
Substitution, Barcelona. Ilaix Moriba replaces Pedri.
Offside, Barcelona. Jordi Alba tries a through ball, but Antoine Griezmann is caught offside.
Offside, Valencia. Gonçalo Guedes tries a through ball, but José Gayà is caught offside.