PSG would have sealed top spot with victory, with anything less allowing in the Gunners, who took control through two Perez tap-ins.
Perez drove in his third from the edge of the box and Alex Iwobi rolled in a fourth before Seydou Doumbia cut through for a Basel consolation.
A 2-2 draw in Paris left Arsenal top of a group for the first time since 2011-12.
Arsene Wenger's side failed to make it past the last 16 that year, and have fallen at the first knockout stage in each of the past six seasons.
Aside from breaking their run of second-placed group finishes, the Gunners have also gone through a group stage unbeaten for the first time since they reached the final in 2005-06.