United couldn't have asked for a better start to the first period as Henrikh Mkhitaryan finished off a great counter-attack in the ninth minute. Further chances fell to Mkhitaryan and Romleu Lukaku but they couldn't double United's tally.
The second period didn't start with quite the same ferocity with Ander Herrera having an effort disallowed, before Dennis Praet fired home an equaliser after the hour mark.
United continued to push and it was Mata's 81st minute strike that sealed another pre-season win for The Red Devils.
Breaking through early on
United travelled to Dublin looking to continue their excellent form in pre-season having won five of their six matches and luck was on their side early on as an goalscoring opportunity for the Italians nearly turned into the opening goal.
It was careless from Daley Blind as his back-pass was heading into the bottom corner which forced David De Gea to handle it. The Spaniard's intervention forced the indirect free-kick, which came to nothing and from that United broke upfield.
Skipper Antonio Valencia blitzed down the right before crossing in. It came to Matteo Darmian who put the ball back across and Mkhitaryan was there to head home.
Continuing to push
The Aviva Stadium clash was the final test before United's Super Cup clash with Real Madrid, and The Red Devils weren't looking to let up anytime soon as they continued to look to add to their tally throughout the first period.
The 21st minute brought an almost carbon copy of the opening goal as Valencia once again got beyond the full-back and got the cross in, once again Mkhitaryan was there to get his head on it but this proved easy for Christian Puggioni to handle.
Three minutes later it was the turn of Lukaku as he exploited Sampdoria's weakness on the right-hand side, the Belgian did well to cut in and curl one towards goal but it was inches wide of far post.
Getting back into it
The contest took more of a backseat in the second period, but the Italians soon cranked up the heat once again as they got themselves back into the clash just after the hour mark.
That wasn't before the majority of the Aviva thought United had added a second. Marouane Fellaini took the ball down and played it into Herrera, whose spectacular scissor kick found the back of the net but the offside flag was up on the near side.
Two minutes after that, Sampdoria equalised with their first real opportunity. It was a decent break as the ball was spread out to Karol Linetty and his cross was cleared by Chris Smalling, but only as far as Praet who coolly slotted past De Gea.
Causing havoc once again
It had been an excellent start to pre-season for Anthony Martial having caused havoc down the wing thus far, and he was at it again as he set up United's winning goal with nine minutes to play.
The young Frenchman burst down the left as he crept into the area and teed it up for Mata across the edge of the area. The Spaniard swept it into the bottom corner to restore United's advantage.
They had the opportunity to add a third in the 86th minute as a floated corner produced an excellent volley from Herrera, which Andrea Tozzo did well to push it away. The ball fell only as far as Marcus Rashford, but Kownacki did well to tip it over as United had to settle for a 2-1 victory.