Barca talisman Messi scored against Valencia for the 10th season in a row to put Barca ahead in the 22nd minute, although Luis Suarez was in an offside position and obstructing the view of goalkeeper Diego Alves.
Barca captain Andres Iniesta had earlier been carried off on a stretcher with a knee injury and Sergio Busquets was fortunate not to earn a second yellow card before the break.
Valencia turned the game round in four second-half minutes, Munir equalising against his parent club and Rodrigo Moreno putting the hosts ahead in the 56th.
Barcelona provisionally go top of the standings on 19 points. Atletico Madrid and Real Madrid, both on 18, play on Sunday, Atletico visiting Sevilla and Real hosting Athletic Bilbao.
Earlier on Saturday, troubled Espanyol produced a stirring second-half comeback to draw 3-3 at home to Eibar and ease the pressure on coach Quique Sanchez Flores.
Espanyol's hard work at getting back into the game risked being undone when striker Felipe Caicedo was sent off for a double booking, but Leo Baptistao grabbed a point with a thumping low finish from outside the box in stoppage time.