Teams Arsenal could play in Champions League last 16
When Argentine striker Higuain struck after 73 minutes, Napoli were on course to qualify for the last 16.
But Kevin Grosskreutz's goal for Dortmund three minutes from time in Marseille sent last season's runners-up through in their place.
Arsenal, who had to lose by three goals in order to miss out, took the sting out of the game with some controlled possession and there was no time for Napoli to grab a third after Callejon had lobbed Wojciech Szczesny to double their lead.
Dortmund, Arsenal and Napoli all finished on 12 points, but the Germans beat Arsenal to top spot on a better head-to-head record. The Gunners pipped the Italians to second place on goal difference.
As runners-up the Gunners will play a top seed, meaning they will be up against holders Bayern Munich, Real Madrid, Barcelona, Paris St-Germain or Atletico Madrid.
Arsene Wenger's side may have been forgiven for not approaching Napoli in their usual attacking manner, but they soon found a rhythm to their passing after an energetic opening from the hosts which saw Goran Pandev test Szczesny with an early shot.
Arsenal's first meaningful opening came on 23 minutes when a flowing exchange of passes ended with France striker Giroud's angled shot being beaten away by home goalkeeper Rafael Cabral.
With Aaron Ramsey and Jack Wilshere on the bench, Mathieu Flamini came into the side and was instrumental in wrestling control in midfield and Rafael Benitez's men committed several fouls as their frustration grew.
The hosts had two decent opportunities to strike before half-time, though, as the energetic Dries Mertens played in Christian Maggio down the right channel. He could only lift his shot over the bar, however, as Szczesny came out to close him down.
The Arsenal goalkeeper then almost gifted Napoli a goal as he kicked Laurent Koscielny's backpass straight at Higuain, but the striker - who was a target for the Gunners in the summer - headed wide from an angle.
What you could have won
Had Arsenal held on to win the group, they would have faced one of these sides in the last 16:
Zenit St Petersburg
Napoli improved around the hour mark and almost went ahead when Raul Albiol's pass found left-back Pablo Armero but his tame shot was easily saved.
Benitez's men then wasted three further chances before Higuain finally made the breakthrough, turning and finding the bottom corner after collecting Callejon's pass outside the box.
With Borussia Dortmund drawing with Marseille at this point, the Stadio San Paolo erupted as Napoli moved into second spot in the group.
The home crowd cheered further three minutes later when Arteta received a second yellow card for a foul on Callejon, having already been booked in the first half.
That set up a nervous finale, and when Callejon scored it looked like there may be a chance for Napoli to knock Arsenal out, but there was only enough time left for the Gunners to take the re-start.
Dortmund's late goal consigns Benitez, who was Chelsea's interim manager at this time last season, to the Europa League for a second consecutive campaign.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.