Electronegativity is a measure of an atom's ability to attract shared electrons to itself.
Nitrogen is more electronegative than phosphorus as nitrogen and phosphorus lie in the same group and we know that electronegativity decreases down the group due to the increase in the distance between the nucleus and the valence shell which decreases the attraction of the electron pair. Hence nitrogen(small size) is more electronegative than phosphorous(large size).