Galway produced a storming finish to score 1-5 without reply and clinch victory at Pearse Stadium.
Wing-back Gary Sice was the hero when he burst forward 11 minutes from time to blast the ball to the net after a good passing movement involving Michael Meehan and Danny Cummins. The sides were level for the fifth time in the game at that stage but Wexford collapsed after that.
Meehan secured possession from the kickout and put four points between them and the rampant Tribesmen tacked on another four points to seal an invaluable victory.
“We are relieved to be honest,” said Galway boss Alan Mulholland. “If we hadn’t come through today we were looking at the other end of the division so that put relegation to bed now I am nearly sure. We can rest easy now after that.”
Cummins, Sean Armstrong and Meehan landed early points for Galway, but Wexford corner-forward Shane Roche shot three points from in the opening half and they trailed by just 0-8 to 0-7 at the break having played against the wind.
Galway went a goal in front with a strong start to the second-half against the wind with points from Paul Conroy and substitute Gareth Bradshaw but Wexford rallied and points from frees by Roche and Ben Brosnan reduced the margin before Redmond Barry equalised after 50 minutes.
Wexford then hit the front five minutes later and looked good for victory when PJ Banville pointed but, remarkably, that was their final score of the match as they wilted after Armstrong levelled the game 13 minutes from time and Sice then added his vital goal.