Atomic number of Nitrogen is 7 hence Electronic configuration of Nitrogen is 1s2 2s2 2p3 Atomic number of Nitrogen is 15 hence Electronic configuration of Phosphorous is 1s2 2s2 2p6 3s2 3p3
On moving down a group in the periodic table, the number of shell increases. Because of which valence electrons move away from the electrons and the effective nuclear charge decreases. This causes the decrease in the tendency to attract electron and hence electro negativity decreases. Because of all these reasons Nitrogen is more electronegative than phosphorus.