The Gunners looked to be closing out a hard-earned 2-0 win at Selhurst Park on Saturday, only for a scrambled effort by Glenn Murray in stoppage time to set up a frantic finale before the substitute almost snatched a dramatic draw when his flying header came back off the base of a post.
A fifth victory from their last six league matches moved Arsenal back above both Manchester United, who lost at Swansea, and Southampton, set to host Liverpool later on Sunday, to maintain momentum ahead of Wednesday's Champions League last 16 first leg showdown with Monaco.
Mertesacker, currently captaining the side with Mikel Arteta still out injured, accepts Arsenal must retain focus at the back if they are to build on the positive work since the turn of the year.
"At the end they tried to put us under pressure and get some strikers on
They nearly scored the equaliser so we were a bit lucky," the German said, quoted by www.arsenal.com.
"Sometimes you lose games, especially at the end, but that was a bit of a warning for us not to switch off too early.
"Overall, though, we are absolutely delighted with the three points and we move on."
Arsenal had taken an early lead through a penalty from Santi Cazorla after Danny Welbeck had been tripped by Pape Souare, which the Palace bench protested happened just outside the area.
It was 2-0 on the stroke of half-time when Welbeck ran across the backline and onto a through ball from Alexis Sanchez.
The assistant referee's flag stayed down, as the England forward went on to drive in an angled shot which Julian Speroni palmed out and Olivier Giroud gratefully lashed into the net for his 50th Arsenal goal.
Despite all of Palace's pressure, Arsenal remained dangerous on the break, with a looping header from Mesut Ozil hitting the top of the crossbar before Sanchez dragged his side wide when played into the left side of the penalty box.
However, so long as the third goal remained elusive, the Eagles sensed there remained life in the match and were driven on by the energy of substitute Yannick Bolasie.
Dwight Gayle sent a bullet header just over before Jason Puncheon was unfortunate to see his 20-yard free-kick drop wide.
Murray's scrambled close-range effort in the third of five minutes of added time set up a tense finale, which was almost a rounded off with the latest of equalisers as his diving header struck the base of David Ospina's left-hand post.
Palace certainly look a well-organised outfit under new boss Alan Pardew, and have a five-point cushion above the bottom three ahead of next weekend's trip across to east London at West Ham.
Murray, though, could not help but reflect on what might have been.
"We pushed Arsenal all the way, and we were unlucky not to get something out of the game
It was a close one, some days they go in and others they don't, but unfortunately it wasn't to be," the striker said, quoted on the club's official website.
"We proved to ourselves that we can compete with these sides and we were unlucky not to get anything from the game.
"We have got a lot of (good) results when the gaffer first came in and I'm sure that'll happen again.
"We have got to take the positives out of the game and can now take confidence from it."
Source : PA