Fierce rivals and champions Real Madrid, five points ahead of Barca, play Eibar on Sunday.
This should have been Barcelona’s third league win on the bounce, having led 2-1 in the second half and grown stronger as the match progressed.
They were given an almighty jolt in the 29th minute when defender Mouctar Diakhaby gave the visitors the lead when he headed in from a corner after being left unmarked.
Valencia had defended well up to that point and felt aggrieved that Barcelona were awarded a penalty just before half-time when Jose Gaya was judged to have pushed Antoine Griezmann over in the area.
After the referee Alejandro Hernandez confirmed the foul following a check of the pitchside monitor, Messi stepped up for what should been his historic moment. However, Domenech made a brilliant save only for the Argentine to then nod home at the far post seconds later.
Barcelona were on top for much of the second half and penetrated the last line of defence once more when Uruguayan defender Ronald Araujo produced an outlandish scissor-kick which beat the reach of Domenech.
Ronald Koeman’s men were desperate to kill the game off with another goal, but as they pressed they were caught by a Valencia counter-attack, which resulted in the deadly Maxi Gomez poking in at the far post.
The 24-year-old Uruguay striker has now been involved in at least one goal in six of his seven La Liga games against Barcelona.
Ex-Liverpool midfielder Philippe Coutinho went close with an angled strike 12 minutes from time, but that was as close as Barca got to scoring again in the closing stages.
28MinguezaBooked at 56mins
18AlbaBooked at 90mins
5BusquetsSubstituted forde Jongat 45′minutes
7GriezmannBooked at 13minsSubstituted forMachado Trincãoat 73′minutes
16GonzálezSubstituted forPjanicat 86′minutes
14CoutinhoSubstituted forLengletat 79′minutesBooked at 90mins
29De la Fuente
14GayàBooked at 45mins
30MusahSubstituted forBlancoat 42′minutesBooked at 45mins