It looked like it could be a frustrating afternoon for the home side as he went scoreless during the game and United seemed to be getting tired.
But with 77 minutes on the clock, Fred broke the deadlock and turned out to be the decisive moment of the match.
United were brilliant at the start, settling into a 4-2-2-2 formation.
Cristiano Ronaldo shot a free kick, before heading to the bar, then seeing a left-footed strike comfortably saved after a good job from Marcus Rashford.
James Tomkins led a strike from Fred over the bar with flying colors, while Jadon Sancho was also belied by a good Palace defense.
Diogo Dalot cut inside and shot the last kick of the first half, as the teams went to level at the break despite United dominance.
The start of the second half was much slower, with United not being able to produce the same intensity in their performance.
Rashford won a free kick after cutting inside, and Alex Telles cut off the top of the bar as he whipped the free kick to the far corner at a tight angle.
Jordan Ayew missed a huge chance to put Palace in front, as he sort of put his effort right in front of goal just a few yards away.
And United made him and Palace pay a few minutes later. Mason Greenwood returned the ball to Fred at the edge of the box, and the Brazilian made a nice finish in the far corner to put his team in front.
Palace tried to push the men forward late, but United held on comfortably enough to fall within three points of the top four.