It took a sending off and a late late strike by a defender, but Dundalk gained the points at Oriel Park, staving off Cork's League celebration for another day.
The home side probably merited the win, if only barely, but they were made to work for it by Bray, who had less of the ball, and threatened Gary Rogers less than Dundalk did their own former keeper.
But on another night, one or both of Aaron Greene's efforts, or Gary McCabe's, or Darragh Noone's, might have reached the back of the net.
And if Dundalk skipper Brian Gartland - another former Bray player - hadn't thwarted John Sullivan by clearing his header off the line seconds before Michael Duffy broke the deadlock, who knows what might have happened.
In the end, what had looked like a seriously valuable point for Bray was swept away, and the prospect of European football slipped a little further towards the horizon.
It wasn't to be Ryan Brennan's night. It started badly, when he needed attention following a challenge inside the opening two minutes, and would end suddenly and needlessly half an hour early with a second caution inside a few seconds when he complained about the occasion of the first.
That said, the visitors had one of the first notable attacks, Greene firing from distance but somewhat wide of target.
But within minutes Dundalk defenders Seán Gannon and Gartland both had efforts needing action by the Seagulls' defence, captain Conor Kenna clearing the first for a corner, and the second headed away as Referee Seán Grant spotted an infringement.
Then Lilywhites' young winger Carlton Ubaezuonu found himself in possession from a Jamie McGrath feed following interplay with David McMillan. He drove hard but high just inside the quarter hour.
McMillan himself shot over ten minutes later following a foul on Duffy, from which it wasn't entirely clear if a quick free or advantage was played.
Greene had another chance soon after that, from closer range but with much the same result.
Just after the half-hour, McMillan carved out another opportunity, bustling past Kenna and Hugh Douglas up route one but Cherrie managed to get a foot in the way of his final low shot.
Hard work by Bray got McCabe into a potential scoring position, but once more the target was missed, and minutes later Duffy got the ball from Shane Grimes and brought another stop from the Bray keeper.
Six minutes from the break, the two Dundalk Under-19s, Ubaezuonu and Jake O'Connor combined to put the Bray net under threat again, the former's pass rebounding at speed from the latter only to rattle against the upright.
And before the interval Noone brought a decent save from Gary Rogers with a low curling shot, and Duffy had a free deflected above the bar following a foul by Douglas on McGrath.
Within minutes of the re-start, another Bray old boy, Chris Shields, brought a fine save from Cherrie with a pile-driver from distance, and McGrath contrived another chance but couldn't keep the ball down.
Then just before the hour, Brennan was fouled, a move that earned cards for Grimes and Bray skipper Kenna, and culminated in the victim being booked twice in rapid succession, and finally dismissed by Grant.
It looked like a final blow for the Seagulls, but it took some little time to fall, the Bray defence managing to stave off what the home fans increasingly saw as inevitable for the best part of half an hour.
Robbie Benson and Shields, again, squandered chances with inaccuracy, and a Duffy free was deflected away, the ensuing flag-kick wasted by indiscipline in the area.
Fifteen minutes from time McMillan struck well, and Cherrie could only parry, but Shields, for whom the rebound fell temptingly, blasted wide.
As the home side mounted wave after wave of attack, Benson shot wide, McGrath's effort was well held by Cherrie, and a Duffy cross was miskicked by Benson in a good position.
But after Sullivan worked his way into a striking position only to see his headed effort following a corner cleared by Gartland, it was McGrath after a one-two with McMillan who fed Duffy for what would be the only score, a low ball under Cherrie's legs into the far corner.
Compiled by Mícheál Ó hUanacháin
Bray Wanderers: 1 Peter Cherrie; 6 Keith Buckley , 2 Hugh Douglas, 4 Conor Kenna (c) , 10 Karl Moore; 23 Jason Marks, 3 John Sullivan; 7 Ryan Brennan +=, 11 Gary McCabe, 22 Darragh Noone; 9 Aaron Greene