Five different structures (L- and T-shaped (LS, TS), parallel (P), parallel-displaced (PD), and linear (L)) of (X2)2 dimers (X = F, Cl, Br, I, N) have been investigated at B97-D3, M06-2X, DFT-SAPT, and CCSD(T) levels. The Qzz component of the quadrupole moment of all dihalogens, which coincides with the main rotational axis of the symmetry of the molecule, has been shown to be positive, whereas that of dinitrogen is negative. All of these values correlate well with the most positive value of the electrostatic potential, which, for dihalogens, reflects the magnitude of the σ-hole. The LS structure is the most stable structure for all dihalogen dimers. This trend is the most pronounced in the case of iodine and bromine; for dinitrogen dimer, the LS, TS, and PD structures are comparably stable. The dominant stabilization energy for dihalogen dimers is dispersion energy, followed by Coulomb energy. In the case of dinitrogen dimer, it is only the dispersion energy. At short distances, the Coulomb (polarization) energy for dihalogen dimers is more attractive for the LS structure; at larger distances, the TS structure is more favorable, as dispersion and induction energies are systematically more stable for the TS structure. For all dimers and all distances, the long-range electrostatic energy covering the interactions of multipole moments is the most attractive for the TS structure. In the case of dihalogen dimers, the preference of the LS structure over the others, resulting from the concert action of Coulomb, dispersion, and induction energies, is explained by the presence of a σ-hole. In the case of dinitrogen, comparable stability of LS, TS, and PD structures is obtained, as all are dominantly stabilized by dispersion energy.