After a slow start to the game by the Red Devils, Mata opened the scoring with a wonderful free-kick late in the first half and added a cool finish early in the second half to make it 2-0.
Javier Hernandez fired in a third and Adnan Januzaj completed the scoring from Mata's back-heel, boosting the confidence of the team ahead of Wednesday's UEFA Champions League clash with Bayern Munich.
Asked if it was the perfect preparation for the game in Germany, Moyes told Sky Sports: "It was a perfect performance in the Premier League, which is most important.
"We didn't start the game as well as I'd have liked but after the first 20 or 30 minutes we got to grips with it and there were some really good performances."
Mata has been criticised for some of his performances since joining United from Chelsea in January, but Moyes has been delighted with the impact he has made.
"I think he has been terrific. I also bought him for his goals, and in the first five or six games he didn't score, but his two goals today and his assist, he has made a big contribution. He has made us better."
Moyes added: "I thought Shinji Kagawa was very good, and Darren Fletcher in midfield, and there were some really good performances.
"It was a great team performance. We had to defend well and the goalkeeper made two or three great saves, and I am really pleased with the result."
Moyes also paid tribute to Hernandez, who got a rare chance to start up front in the absence of Wayne Rooney and Robin van Persie.
"He is a player we value a lot and he makes great contributions to the team, whether that is coming off the bench or starting," said the boss.
"He is a talented footballer and his stats are up there with the best of them."
Rooney missed the game after picking up a toe injury in Tuesday's first leg against Bayern at Old Trafford, which finished as a 1-1 draw.
Moyes insists that he will be given every chance to recover for the return leg, but he expects it to be touch and go.
Questioned on when a decision might be taken on Rooney, Moyes said: "I think probably eight o'clock on Wednesday night. That will be the timescale because he is a massive player for us and we'll try and get him back."