The magnetic needle aligns in a direction which is tangential to the magnetic field of current carrying wire at the point of location.
The magnetic field of a current carrying wire is in a circular loop. Let a compass needle be placed at any point on the circumference of such a circle. The magnetic needle will align in a direction which is tangential to the circle at the point of location. The alignment of the NS dipole is ascertained by the right hand grip rule.
See details in this answer.