Cobh Ramblers remain rooted to the foot of the table after a controversial match at St Colman’s Park.
The home side lead after 41 minutes when Davin O'Neill scored from close range.
Bray equalised through Ger Rowe eight minutes after the break, before Ramblers had a goal by Daryl Kavanagh disallowed for pushing.
Bray struck for a late winner from a Mark Duggan volley, before Alan Cawley was red carded for retaliation.
Both sides came into the match on a run of poor results, with Bray after losing their last four league games without scoring a goal.
Rock bottom Ramblers had drawn their last two away matches, but had not won at home since 12 April and had lost their previous five encounters in front of their own supporters.
The home side started brightly and forced three early corners to put the pressure on experienced goalkeeper Alan Gough, who dealt well with the deliveries from Alan Carey at set pieces.
But Cobh deserved their lead which came four minutes before the break, which was well created by Daryl Kavanagh down the right touchline.
His cross from the end line was missed by the boot of striker Graham Cummins, but Davin O'Neill was following up at the far post to tuck home his first goal of the season.
Stephen Henderson's side almost streched the lead two minutes after half time, when Gough produced a marvellous one handed save, diving to his left to touch away a Ross Gaynor shot.
Cobh were caught out after 53 minutes by a fine counter attack from Bray which produced the equalising goal.
The visitors cleared a corner kick, which was picked up by Aidan O'Keeffe on the half way line,the forward made good progress before passing to substitute Paul Dunphy and his cross shot was side footed home from close range by Ger Rowe for his fourth goal of the season.
Then there was drama as first Cobh had a goal disallowed when Kenny Coleman crossed and Daryl Kavanagh headed home But the referee Ian Stokes disallowed the effort for apparent pushing by the scorer.
There was an even bigger talking point on 81 minutes when Kavanagh tumbled after a challenge form Ray Kenny.
Stokes pointed to the spot,and with Ramblers Kevin Murray about to take the kick, the referee was called by his assistant Ken Hennessey.
After the consultation, Stokes called Kavanagh who he booked and awarded Bray a free out, which was greeted with dismay by the home bench and the fans.
To compound Ramblers frustrations, Bray scored a brilliant winning goal.
Ger Rowe crossed for Mark Duggan to sent a screaming shot past the diving James McCarthy from just inside the box.
In stoppage time Alan Cawley was breaking into the Cobh half when he was fouled by Colin O'Brien. Cawley pushed the Cobh player and was shown a red card by the referee, with O'Brien getting a yellow card.
So it is a sixth home defeat in a row for Ramblers. For Bray a first win after four straight defeats sends them into mid-table safety.
COBH RAMBLERS: McCarthy; Carey, Murray, Guthrie, Coleman; Kavanagh, O'Brien, O'Halloran, O'Neill; Gaynor, Cummins.
Substitutes: O'Shea for Gaynor 74 mins, A Kearney for Kavanagh 89.
BRAY WANDERERS: Gough; Pender, Kenny, Doherty, Cronin; Kavanagh, Cawley, Robson, Duggan; Rowe, O'Keffe.
Subs: Whelan for Kavanagh (inj) 28 mins, Dunphy for Robson 51, Foran for Pender (inj) 64.
Referee: Ian Stokes(Dublin).