The Catalans needed to come from behind to keep their title hopes alive as Eliaquim Mangala powered home Dani Parejo’s corner to put Valencia in front.
It was the third goal Barca were conceding from corner kicks in one week following their 2-1 defeat at Deportivo La Coruna.
The lead lasted only six minutes however as Luis Suarez raced onto a throw-in from Neymar to fire into the far corner.
Mangala then showed his erratic side as he pulled down a goal-bound Suarez to concede a penalty and get sent off.
Messi made no mistakes from the spot, beating Diego Alves to put the hosts in the lead for the first time on the night.
But Barca’s defensive frailties was on show again as they were caught cold straight from the kickoff, Jose Gaiya teeing up Munir El Haddadi to score against his former club for the second time this season.
Messi, once again dispelled the whiff of danger by drilling home at Alves’s near post seven minutes into the second period for his 25th La Liga goal and 41st overall this season.
Suarez and Neymar came close to extending the lead before substitute Andre Gomes made sure of the points by tapping home Neymar’s cross for Gomes his first Barca goal.
Earlier, Antoine Griezmann was the hero for Atletico Madrid as he teed up Diego Godin’s opener and then struck a stunning free-kick in a 3-1 win over crumbling Sevilla.
Koke added a third for Diego Simeone’s men before Joaquin Correa registered a consolation for Sevilla who have slipped of the title race in recent weeks.