Messi equals Pele's record of goals for a single club
Messi headed in from Jordi Alba's cross after his first-half penalty was saved to equal the mark set by the Brazilian great for Santos.
But Messi was left frustrated as a dogged Valencia forced a draw to leave Barcelona eight points behind leaders Atletico Madrid, who beat Elche 3-1 earlier in the day.
"There were times tonight with good football, we had total control of the match, especially after leading 2-1 where we tried to get the third, but there were also times when we lost the ball in the danger zones," said Barca coach Ronald Koeman.
"What worries me is that sometimes the team doesn't know what the game is about.
"We know we're a team that always likes to attack and score goals, but there are also times when you have to defend and control the game.
"But the race for the title is not yet lost, we are far behind, but it's a very complicated season for everyone. In two months, the situation may be totally different."
Barcelona started slowly and went a goal behind to Mouctar Diakhaby's unchallenged header from a corner after half an hour.
Antoine Griezmann earned the penalty that led to Messi's record-equalling goal when the France attacker was nudged over by Jose Gaya.
Barcelona went ahead thanks to a superb scissor kick from Uruguay's Ronald Araujo.
But Valencia's pressure was rewarded when Maxi Gomez got in front of Barca central defender Oscar Mingueza to turn in a cross and equalise.
Philippe Coutinho drove a shot just wide with 12 minutes remaining and Messi curled a free-kick wide but Barcelona were forced to share the points.
Elsewhere, Luis Suarez scored twice from close range in a 3-1 victory for Atletico to move Diego Simeone's side three points clear at the top.
In a tight first half at the Wanda Metropolitano, Atletico wasted a clear chance to take the lead when France forward Thomas Lemar drove the ball straight at Elche 'keeper Edgar Badia as the defence opened up.
Suarez was far more clinical in the 41st minute as the Uruguay forward got the slightest of touches to steer Kieran Trippier's cross past Badia to take the lead.
The former Barcelona and Liverpool attacker then stretched to poke the lively Yannick Carrasco's pass into the net in the 58th minute.
Lucas Boye's powerful header gave Elche hope in the second half but substitute Diego Costa, who has not hidden his frustration at being relegated to the bench since Suarez's arrival, fired in a penalty with ten minutes remaining to wrap up the three points for Atletico.
"I'm very happy to be able to play again," Costa told Movistar after the game.
"I have taken some hard blows but I always pick myself up again. It's hasn't been easy but I have enough strength to fight."
Atletico have three more points than Real Sociedad who visit Levante later Saturday.
Champions Real Madrid play Eibar away on Sunday.