A goal in the 94th minute by substitute Kieran O'Reilly, who tucked home the rebound after his penalty was saved by Jason Russell, has preserved leaders Cobh Ramblers' brilliant 27-match unbeaten record.
Wexford took the lead in the first minute through a Darren Browne header, but Ramblers equalised when Graham Cummins fired home in the 20th minute.
Michael Mulconry handled on the line and was sent-off as Conor Sinnott sent Wexford in front before the break, until the home side's late dramatic leveller.
The last time that Cobh had lost a league game was against Wexford back on 18 March, which was Ramblers only away defeat of the season.
The home side had come into the match with a one-point lead at the top of the table following second-placed Finn Harps win at Shelbourne the evening before.
But the leaders were without influential midfielder Shane Barrett who was suspended for accumulation of points.
They also suffered the late withdrawal of top scorer Davin O'Neill who had picked up an injury in training during the week.
The visitors got off to a brilliant start when they scored after just 30 seconds, Patsy Malone and Liam O'Loughlin combined on the right wing and when the cross came into the penalty area, Darren Browne headed home at the far post.
The leaders pushed forward and equalised after 20 minutes when centre forward Graham Cummins sent a shot from outside the penalty area past Jason Russell.
There was a major turning point in the game after 36 minutes, when with Cobh on top and creating chances, they conceded a penalty when midfielder Michael Mulconry handled on the goal line to prevent a Wexford goal.
Referee Padraig Sutton sent-off the Ramblers player and awarded the penalty, which Conor Sinnott put in the corner of the home net, in off the hands of goalkeeper James McCarthy.
After the break, Cobh kept playing football as Wexford sat back in an attempt to hold on to their lead. The home side created a number of chances, the best falling to Cummins who burst into the penalty area, before rolling his shot wide.
But it looked as if their six-month unbeaten run would come to an end until substitute Kieran O'Reilly took centre stage.
In the last minute of injury-time he was fouled in the penalty area, he took the kick himself, but goalkeeper Jason Russell dived to touch his shot away only for O'Reilly to score from the rebound.
So Ramblers move two points ahead of Finn Harps who they meet next Friday night in Ballybofey in a top of the table clash.
COBH: McCarthy; Carey, Murray, Guthrie, Meade; Cambridge,
Coleman, Kearney, Mulconry; O;Shea, Cummins.
Substitutes; C Meade for Cambridge 67 mins, O'Reilly
for O'Shea 80.
WEXFORD: J Russell; A Russell, Larkin, Rossiter, Kelly,
Malone, O'Loughlin, O'Connor, Browne, Sinnott, Bradley.
Subs; Kearney for Browne 62.
Referee: P Sutton.