The Ghanaian netted from close range in the 65th minute after quickfire goals from James Ward-Prowse and Armando Broja had cancelled out Wilfried Zaha's early opener for Palace in a pulsating first half.
The result lifted Palace two places up to 11th on 20 points from 17 games while Southampton stayed 15th on 17 points, six above the bottom three although 18th-placed Burnley have two games in hand.
Palace manager Patrick Vieira was unhappy after his team threw away an early lead.
"I don't think we did enough," said the former Arsenal and France midfielder. "We started well but they put us under pressure and we couldn't build from the back.
"At the end of the first half they were the better team and they wanted to win more than we did. We came back in the second half with better ambitions to compete."
Ward-Prowse had mixed feelings about the outcome after Southampton faded away in the second half.
"I don't think we started the game very well but got back into it, a scrappy goal we conceded ultimately cost us all three points," he said.
Zaha struck in the second minute when he cut inside and fired a low shot past two defenders inside the near post, with Palace missing several chances to double their lead before Ward-Prowse levelled with a 32nd-minute free kick.
The Southampton captain curled in a delightful effort from 25 metres with home goalkeeper Jack Butland unable to keep it out although he got his fingertips to the ball.
With the home side reeling, Albania striker Broja turned the tide in the 36th minute when he took the ball in his stride and drilled a low shot from 20 metres into the bottom right corner.
Visiting keeper Willy Caballero denied Odsonne Edouard with a double save in the 58th minute and also deflected away the striker's shot seven minutes later but Ayew was perfectly placed to sweep in the rebound from a tight angle.
Neither side were able to find a breakthrough in the closing stages, with Palace looking the more likely to score with several raids down the right flank.
Southampton boss Ralph Hasenhuettl said he had expected a share of the spoils.
"From two teams always drawing this season, it was a logical result," said the Austrian. "I think they had one chance in the second half and scored. We didn't have big chances in the second half.
"We absolutely deserved a point minimum. We had 20 minutes in the second half we were struggling but after the (Palace equaliser) we played brave and tried to make the third goal."