Manchester United defeated Luton Town 3-0 in the third round of the Carabao Cup on Tuesday.
The win will see Ole Gunnar Solskjaer's men take on either Preston North End or Brighton in the fourth round of the competition.
Mata's strike came in the 44th minute after Luton Town coughed up a ball at the back. Left-back Brandon Williams was taken down by a clumsy challenge from George Moncur and the former Chelsea and Valencia man calmly scored from the spot.
United goalkeeper Dean Henderson made a stunning save from a corner, and Eric Bailly cleared a subsequent shot off the line in the 81st to maintain the one-goal margin and avoid a potential penalty shootout.
Rashford and Greenwood then put the final touches on the win with a pair of cool finishes in the final minutes.
"Well, going through is the big thing. There are some positives, the keeper [Dean Henderson] does his job, we scored some nice goals towards the end, apart from that it was a good workout," Solskjaer said after the match before praising Henderson's critical save.
"That is probably the job our keepers sometimes have to do, you have to make saves when needed and David [de Gea] has done that for years and Dean did that today," he said.
Henderson tweeted afterwards: "I dreamt about this my whole life!! Unbelievable feeling to make my debut for the club I love!! Clean sheet and a win to top it off!!!"
Solskjaer began the match with Bruno Fernandes, Rashford and Greenwood on the bench before bringing all three on in the second half.
On resting his regulars, he said: "We just have to take it day by day and game by game. I didn't want to give [Fernandes, Rashford and Greenwood] more than that because we will have a hard day tomorrow."