You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
Palace, who have never beaten United in the Premier League, took the lead after 11 minutes when Andros Townsend ran onto Christian Benteke’s square ball and struck a left-foot shot that deflected off Victor Lindelof past goalkeeper David de Gea.
The hosts went 2-0 in front three minutes into the second half when Jeffrey Schlupp took a quick free kick after a foul on Benteke and left back Patrick van Aanholt raced at goal before firing past De Gea to put Palace in the driving seat.
United pulled a goal back seven minutes later when the unmarked Chris Smalling headed in Antonio Valencia’s cross and equalised in the 76th when Alexis Sanchez's effort came back off the bar and Romelu Lukaku turned two defenders to fire home.
Matic then snatched the points when his volley from 25 metres curled away from diving keeper Wayne Hennessey into the top corner to put United back into second spot on 62 points, 16 behind Manchester City, and left Palace in the relegation zone.
"It was a nice goal," said Matic. "I am happy for the team, not because I scored but because we won and picked up the three points. We showed character after going 2-0 down and they had the crowd behind them.
"We are delighted to have turned it around. Every point matters and it's so important to win games like this."
United's win put them nine points ahead of fifth-placed champions Chelsea in the battle for the top four which brings a place in next season's Champions League group stage.
It also took Jose Mourinho's team back above Liverpool, who are two points behind before the pair clash at Old Trafford on Saturday, with Tottenham Hotspur a further two points behind.
With nine games left, Palace are third from bottom with 27 points but only a point outside the safety zone.
When Townsend struck the opening goal it was the first time Palace had led United in the Premier League and the home fans could hardly believe their eyes when their Dutch international Van Aanholt beat De Gea at his near post with a rasping drive.
However, Palace's second goal stung United into life and they were soon back in the match when Valencia clipped a cross to the far post where Smalling was lurking on his own to direct a header back across Hennessey's goal into the far corner.
The game was then an absorbing end-to-end battle as both sides attacked but United found the equaliser when Sanchez's shot was deflected onto the bar and came back for Lukaku who managed to find some space inside the area and fired home.
The game was still on a knife edge but United started to pile on the pressure and the almost inevitable breakthrough came when the ball fell to the visitors' Serbia midfielder Matic, who instinctively struck a superb shot into the top corner.
It was the first time United had come from two goals down to win a Premier League game since December 2013 while Palace, who have failed to beat United in 18 Premier League meetings, had never lost in the competition with at least a two-goal lead.