Jack Butland, making his fourth Premier League start in four years, was the hero of the first half for Crystal Palace. The former Stoke City goalkeeper saved from Leandro Trossard after the Brighton man raced through following a mistake by Joel Ward.
Butland, who was at serious fault for Millwall's goal in the FA Cup last weekend, bounced back in fine fashion as he saved a poor Pascal Gross penalty.
Moments later, the hosts had a goal ruled out after a VAR review showed Neal Maupay had knocked the ball out of Butland's hands before finishing.
It was a familiar story, Brighton were dominant but could not make it count. Palace hardly improved after the break, with Jakub Moder hitting the bar from Gross's cutback.
But it was the Eagles who stunned their hosts on the break. Having hardly had a kick in the Brighton half, those in yellow flowed through with Ward at the heart of the move. The full-back finally found Jeffrey Schlupp who managed to cutback for Gallagher to take a touch and smash home.
Palace thought they were pulling off another smash and grab at this ground but a game between these two sides is nothing without a late goal and this time it came courtesy of Andersen - at the wrong end.
The Danish defender had impressed but stuck his leg out to block a cross from Neal Maupay and prodded the ball between the legs of his own goalkeeper.
Here is how Jack Rosser rated Crystal Palace...
Jack Butland 8
Superb save to deny Trossard and then a decisive penalty stop - his first ever in the Premier League. Could do nothing about Andersen poking the ball through his legs.
Joel Ward 7
Recovered from an early poor header, defended well and became a driving and creative midfielder for a moment in the build-up to the goal.
Marc Guehi 7
Defender Brighton's bombardments well alongside Andersen at the back.
Joachim Andersen 5
Had impressed at the back until the last few minutes. Prodded the ball through the legs of his own goalkeeper with no one in a Brighton shirt too close.
Tyrick Mitchell 6
Struggled at times down the left, especially after the introduction of Tariq Lamptey.
Will Hughes 5
Poor decision making for the penalty and snapped into a few challenges a bit too eagerly.
Jeffrey Schlupp 6
Struggled to get any real control throughout the game but did superbly well to get the ball back and tee up Gallagher for his goal.
Conor Gallagher 7
A passenger for the first half but showed superb awareness and technique to get into place and score the opener.
Eberechi Eze 5
Making his first Premier League start since suffering an achillies injury at the end of last season. Struggled to make an impact.
Michael Olise 7
A rare spark for Palace in the first half and played a small role in the Gallagher goal. Always exciting to watch and becoming more of a key man with each game.
Odsonne Edouard 5
Working off of slim pickings up top but hardly imposed himself.
Luka Milivojevic 6
Helped Palace gain a little more control over midfield.
Jean Philippe-Mateta 6
Gave Crystal Palace a focal point shortly after coming on and was a key cog in the move to create the goal.
Christian Benteke n/a