UV spectroscopy of charge exchange collisions between N5+ ions and H2, He