The atomic number of Nitrogen is 7, Electronic configuration of Nitrogen is 1s2,2s2,2p3
The atomic number of Phosphorus is 15 , Electronic configuration of Phosphorous is 1s2,2s2,2p6,3s2,3p3
On moving top to bottom a group in the periodic table, the number of shells increases. Due to this, valence electrons move away from the electrons and the effective nuclear charge (Z*) decreases. This causes a decrease in the tendency to attract electrons and hence electronegativity decreases. Because of all these reasons, Nitrogen is more electronegative than phosphorus.