Mata completed the rout from Chelsea pal Torres' pass just moments after coming on as an 85th-minute sub.
Torres said: "Juan had a difficult Euros, he hadn't played a minute. That was very hard for him because he enjoyed such a great season at Chelsea.
"I was lucky enough to give him the pass for the goal. He deserved it and one of the most beautiful things for me on the night was to see him so happy."