Charlie Adam fired Stoke ahead at Selhurst Park, but Gayle responded immediately after the interval before striking the winner with a delightful 25-yard free-kick midway through the second period
The 2-1 victory ensured Palace, who were as high as fifth at Christmas, will enjoy another season of top-flight football
And Gayle, the 25-year-old striker who has featured just 17 times for Palace this season, could now be handed a chance to shine against United in a fortnight's time
"Gayle has had a funny season because injuries and our form in the first half of the season has really limited his time," said manager Alan Pardew
"Then we had a little problem with him because obviously he isn't getting the game time
Is he going to stay? Is he going to go?
"Me and Steve Parish were talking to him about a new deal and in the end we managed to do that
We secured him and the reason we secured him is because he scores goals
"Those two goals were massively important - they were both great strikes - and he has put himself in contention of course for Wembley."
Palace's comeback victory against Stoke was only their second win in 20 league outings
Pardew, who is now set to sign a new contract with the club's Premier League status intact, has vowed to make changes to his squad in the summer
"The second half of the season we should have had stronger results," Pardew added
"That is a concern
I have to look at in the summer and we will change three or four members of the squad, but it won't be radical changes
"We know we need to go forward and we were not far away with our best team
So, we'll try and keep our best team, add a little bit of quality around it, and we'll be fine."
Stoke have now lost four of their last five matches, and boss Mark Hughes was disappointed with his squad's reaction after the interval.
"The half-time break came and we talked at length about how the opposition will have a reaction and try and come out fast and quick," Hughes said
"We needed to be ready for that and unfortunately we were far from that and allowed them straight back into the game with a great deal of help from us
"We had three or four missed tackles on the edge of the box and you can't afford to do that at Premier League level."
Source : PA