The point lifted the Hammers to first place in the Premier League table, though David Moyes' side will feel that they could have taken all three points against a Palace side that struggled to deal with their high press.
West Ham took the lead six minutes before the break with a brilliantly worked goal as Said Benrahma set Michail Antonio free through the middle and he and Pablo Fornals exchanged some intricate passes in the box before Fornals scored with a simple finish.
After two goalless outings for Palace so far this season, Gallagher finally got his side's first league goal under new boss Patrick Viera 13 minutes into the second half, scooping the ball home from a tight angle.
The Hammers went back in front when Joachim Andersen was out-muscled under a high ball by Antonio, who slammed the ball home to register his 50th Premier League goal.
The lead lasted only a couple of minutes as Gallagher levelled again with a beautiful turn in the box and a low finish to the bottom left-hand corner to make it 2-2 and grab a share of the spoils.
Despite having had problems with West Ham's physicality all afternoon, Palace almost won the game when Declan Rice conceded a free kick in stoppage time, but defender Marc Guehi headed just over with the goal at his mercy.
Palace's second point in three games lifts them to 14th spot and Viera was delighted with the character his team showed.
"We knew it was going to be difficult. We came here with a really good game plan. In the first half we played with the handbrake on, but we were brave enough to put the pressure on them in the second half," he told Sky Sports.
"We deserved the two goals and the point. This game will give us confidence and belief for the rest of the season. There is more to come from this team.
They may have moved back to the top of the table on seven points, but West Ham were not happy with how they performed.
"The players are disappointed in the dressing room, but that tells you the standards we have set ourselves. We just didn't play to the standards we have reached in recent weeks," manager David Moyes told the BBC.