A diagonalization scheme for the shell model mean-field plus isovector pairing Hamiltonian in the O(5) tensor product basis of the quasi-spin SUΛ(2) ⊗ SUI(2) chain is proposed. The advantage of the diagonalization scheme lies in the fact that not only can the isospin-conserved, charge-independent isovector pairing interaction be analyzed, but also the isospin symmetry breaking cases. More importantly, the number operator of the np-pairs can be realized in this neutron and proton quasi-spin basis, with which the np-pair occupation number and its fluctuation at the J = 0+ ground state of the model can be evaluated. As examples of the application, binding energies and low-lying J = 0+ excited states of the even–even and odd–odd N∼Z ds-shell nuclei are fit in the model with the charge-independent approximation, from which the neutron–proton pairing contribution to the binding energy in the ds-shell nuclei is estimated. It is observed that the decrease in the double binding-energy difference for the odd–odd nuclei is mainly due to the symmetry energy and Wigner energy contribution to the binding energy that alter the pairing staggering patten. The np-pair amplitudes in the np-pair stripping or picking-up process of these N = Z nuclei are also calculated.