The Argentine had put Barca ahead on 11 minutes.
Then Messi and Helder Postiga each struck two goals in seven first-half minutes as Barcelona maintained their 100 per cent start to the season.
Barca coach Tata Martino said: "I'm concerned that that we gave Valencia five to ten minutes of respite when we were ahead by three goals. You cannot give your opponent opportunities. If they are given it has to be because they created them and not because we gave them away.
“We could have ended with a 3-3, 2-3 or 2-5. Regardless of what could have happened I would leave here very pleased with how the team played. We found what we were looking for."
For the big stories and the banter follow us on Twitter: @tribalfootball