if these two elements are in the same period, then they have different number of protons. the ionisation energy is therefore related to the nuclear charge, and the nuclear charge acting on the valence electrons would therefore be related to the number of protons. of course you must be able to relate to exceptions such as removing electrons frm 2p4 vs 2p3..