Alexandre Lacazette’s stretching volley gave Arsenal the lead in the 14th minute but Ayoze Perez clipped in Newcastle’s equaliser on the half hour mark.
Newcastle were the better side after the break and took the lead in the 68th minute when Matt Ritchie fired home after a neat flick from Perez.
Newcastle have 41 points in 10th place with sixth-placed Arsenal on 54 — 13 points behind fourth-placed Tottenham Hotspur.
“40 points was the target at the start of the season and hopefully we’ve done enough now to secure our Premier League status,” Matt Ritchie told Sky Sports.
“Now we want to keep going and try to finish as high as we can in the table,” he added.