Nitrogen (N) has an atomic number of 7, meaning it has 7 electrons. Its electronic configuration is 1s²2s²2p³.
Phosphorus (P) has an atomic number of 15, meaning it has 15 electrons. Its electronic configuration is 1s²2s²2p⁶3s²3p³.
Electronegativity is the ability of an atom to attract electrons towards itself in a chemical bond. Electronegativity generally increases across a period (from left to right) and decreases down a group (from top to bottom) in the periodic table.
Both nitrogen and phosphorus are in group 15, but nitrogen is higher up in the group. As electronegativity decreases down a group, nitrogen will be more electronegative than phosphorus. Nitrogen's smaller atomic size and closer proximity of its valence electrons to the nucleus result in a stronger attraction for shared electrons in a bond compared to phosphorus.