Barnett's 49th minute free
A first half dominated by the Seagulls, producing no score and followed by a strong opening to the second period, saw the home side build a much stronger threat, though that started to weaken in the final twenty minutes.
But the last five (and the six minutes added) proved a major downfall for the Wanderers, as Treaty substitute Willie Armshaw fired a beauty past Brian Maher, and a minute later Mark Byrne completely misjudged his defensive header to find his own side's net.
Almost from the opening whistle, Joe Doyle was iun the thick of things, unlucky to be found offside in a scoring position in the first minute.
Richie O'Farrell, who possibly covered more ground than any other player, was all over the place, but unfortunately so were some of his passes. An early error, three minutes in, was recovered partially due to a free out awarded by Referee Oliver Moran, whose early partiality to the whistle was moderated later at the cost of some curious decisions.
In the fifth minute, a Brandon Kavanagh shot brought Treaty keeper Tadhg Ryan into play, but without troubling him unduly. He would have some of that later.
Four early corners from Mark Byrne showed that the visitors were following the same script that had brought them victory the previous week, without quite reaching the intensity of the opening phases in Wexford, but the home defence managed to keep the movements at bay.
Between these setpieces, a nice crossfield loft from Bray skipper Aaron Barry found Ryan Graydon on the right sideline, but the winger couldn't keep the ball in play.
A quarter of an hour in, in Treaty's first attack of any substance, following a Joel Coustrain move from the right, Kieran "Red" Hanlon found Coustrain now wide left, but the move fizzled out when a Jack Lynch cross from the righthand corner failed to find a team-mate.
Minutes later, a neat cross from Steven Kinsella almost found the onrushing Doyle, but Ryan got there first and Doyle, rather than the ball, ended up in the net, and Conor Clifford's speculative effort was well off target, though there was a hint of a defensive touch on it as it passed.
Midway through the period, Brian Maher was caught just outside the area, and under pressure from Matt Keane was forced to concede a corner, but Marc Ludden's flag kick came to nothing, and a good counter-attacking raid led by Dylan Barnett ended with another Doyle header just too high.
Doyle shot low and without much power at Ryan seconds later, and following a little uncertainty in the United defence found himself at close quarters with Ryan, but O'Farrell's nod to his head lacked pace and was difficult to direct.
Shortly after the half hour, Clifford's ball found Byrne on the endline, but he in turn couldn't keep it in play, and minutes later Barnett worked his way through defenders to shoot - but straight into Ryan's arms.
O'Farrell shot narrowly left of the Treaty posts under pressure from Anto O'Donnell, and moments later the home centre-half pounced on a loose pass from the same Bray player, but the attempted counter-attack petered out.
With only minutes left to the break, Hanlon, who had had little service in his role as sole striker, took charge of a free 20m out at the left of the area, but fires wide of the far post.
A Clifford effort in the final minute took a slight nick off the defence on its war, but following Kavanagh's corner O'Farrell's header was cleared away by Sean Guerins.
A good restart by the Seagulls saw O'Farrell again shooting to Ryan, and thre home goalie heading away just outside his area, and O'Donnell cleared Kinsella's cross from Byrne's throw.
Barnett shot a free just over the bar from an identical position to Hanlon's free before the break.
Almost ten minutes in, O'Donnell cleared O'Farrell's cross in a tricky position, but the attack was pressed again and ended when Clifford fired just over after a Byrne corner.
Keane was brought down by Graydon in the course of an attack - but the decision was a free out to Bray.
Maher's first serious involvement was at the end of a great ball through by McCarthy for Matt Keane, who shot powerfully towards the target, and the goalie, who was going down the wrong direction, managed to leave a hand in the way to bring off an impressive save.
Uncharacteristically, the keeper misthrew a clearance shortly after, gratefully intercepted by Coustrain and fed on to Ludden who crossed to McCarthy who fired a strong shot from distance but saw it come back off the far upright.
In the next few minutes, Gary Cronin withdrew the lively Kinsella and dangerous Doyle to bring on Gary Shaw and Darren Craven. In between those substitutions, O'Farrell had another go, this one low and lacking power, easy for Ryan; and a brace of corners once more produced nothing for the visitors.
With just twenty minutes left, Keane threaded a ball through for Hanlon, who headed just left of the goal. But though Treaty were getting forward more when they had possession, Bray still dominated, and Kavanagh fired a speculative effort that Ryan barely kept in play, and within a quarter of an hour of the end O'Farrell popped up on the left with a shot that Ryan did well to palm away, and Graydon fired high and wide with the loose ball.
Bray sub Craven. as had several of his teammates, shot straight at Ryan on 78 minutes, and O'Farrell, for all his waywardness, seemed harshly done by with a caution for his collision with Ludden.
Kavanagh pumped a ball into the area for Shaw, but Ryan got there first. His counterpart came forward out of his area to deal with Treaty sub Willie Armshaw's well-directed through ball for Lynch, and shortly thereafter claimed cleanly from Keane.
Ed McCarthy shot narrowly wide of Maher's left post after a good ball from Matt McKevitt, and moments later Shaw claimed a free on fairly shaky grounds, but a head put Kavanagh's deadball over the bar, and the goal-kick was given despite suggestions that the head might have been O'Donnell's.
Less than five minutes remained whehn the diminutive Armshaw tricked his way past Byrne and Andrew Quinn to fire from the end-line just over Maher to the far corner of the net.
It got worse for the Wanderers a minute later when Keane's looped ball was headed sweetly to the bottom of the Bray net by Byrne, who was trying to prevent it reaching Armshaw at the back post.
The Seagulls continued to press, with a pair of corners in the final minute of regular time, and Kavanagh getting in a shot but off target. Graydon earned himself a caution for what was seen as a late tackle on Lynch, and deep in time added Maher saved well low at the near post from McKevitt.
But there was to be no late late show, and Bray lost a game in which if anything they may have increased their average percentage possesion stats.
Mícheál Ó hUanacháin
Bray Wanderers: 1 Brian Maher; 8 Mark Byrne , 4 Andrew Quinn, 5 Aaron Barry (c), 3 Dylan Barnett; 7 Ryan Graydon , 6 Conor Clifford, 22 Stephen Kinsella; 11 Brandon Kavanagh, 14 Richie O’Farrell ; 9 Joe Doyle