It was the Exiles' first pre-season defeat this summer, and a huge boost for new Welsh Premier side Barry.
Wrexham were 2-0 winners away at Altrincham.
Goals by Marcus Kelly in the first half and Chris Holroyd's flick header in the second half, gave the visitors the victory as they made up for Saturday's defeat by Nantwich.

Last week Mr Cameron told the BBC he would not serve a third term as PM.
Asked by Andrew Marr if that meant Mr Cameron would have to "stand down at some point during the next Parliament", Mr Duncan Smith replied: "He does."
Downing Street said the PM would serve "every single day" of a second term.
In his BBC interview on Monday, the prime minister said that, if re-elected this May, he would serve the full five years of another Parliament and then leave Number 10 - leading Labour to accuse him of arrogance.
Mr Duncan Smith told BBC One's Andrew Marr Show the "way that all comes about will have to be discussed" adding that Mr Cameron would "serve what essentially is a full term" - but there would "of course" be a leadership contest at some point.
"You've had to literally rap the knuckles of people like Gordon Brown and previous prime ministers to get them to think of going," he said.
"[Mr Cameron] is actually very keen to say 'there is a limit, there's an amount of time a prime minister should serve before they get stale,' and he is right about that."
Mr Cameron has tipped Home Secretary Theresa May, Chancellor George Osborne and London Mayor Boris Johnson as potential successors.
But Mr Duncan Smith said that, having been Conservative leader at a time when the party "was quite interested in having a fight in an empty room", he would not make predictions.
He said he expected the next Conservative leader would already have been "in the public sphere for some time".
Following Sunday's interview, a Downing Street source told the BBC: "David is very clear he will serve a full five-year second term, every single day of that as prime minister.
"In terms of what happens in five years' time, we'll sort that out in five years' time."
A YouGov poll for the Sunday Times  has suggested Labour has a four-point lead over the Conservatives, putting Labour on 36% with the Tories on 32% - while an Opinium poll for The Observer suggests the Tories are on 34% and Labour are on 33%.

Iva Barr, from Bedford, was taking part in her 20th marathon, completing about 14 miles of the route.
Ms Barr has been running marathons for "30-odd years" and took part in the first London Marathon in 1981.
She said she would "never forget" her final attempt at the famous event, despite not quite completing the route.
Ms Barr tackled the first 14 miles of the marathon before taking an Underground train to Westminster, and walking the final part of the course to The Mall.
"I rather wanted to go out in a blaze of glory," she said. "That didn't happen but I still had a great day."
And she said she had "no regrets" about giving it a go.
"I just thought 'I really can't do this and I don't think I should carry on'," she said.
"But in the end I only didn't do about eight or nine miles, because I gently walked the last couple of miles to the finish line.
"It was so wonderful, everybody was fantastic with me, especially the young people. I will never forget it."
Kayne McClaggon scored twice as Barry Town United beat League Two Newport County 2-0 at Jenner Park.
[NEXT_CONCEPT]
The Conservatives would have to choose a new leader before the end of the next Parliament if David Cameron wins a second term as prime minister, Welfare Secretary Iain Duncan Smith has said.
[NEXT_CONCEPT]
An 88-year-old woman who became the oldest competitor in this year's London Marathon has confirmed Sunday's event will be her last.