Perovskites with Bi or Pb on the A-site host a number of interesting and yet to be understood phenomena such as negative thermal expansion in BiNiO$_3$. We employ hard x-ray photoemission spectroscopy of Ni 2$p$ core-level as well as valence band to probe the electronic structure of BiNiO$_3$ and PbNiO$_3$. The experimental results supported by theoretical calculations using dynamical mean-field theory reveal essentially identical electronic structure of the Ni-O subsystem typical of Ni$^{2+}$ charge-transfer insulators. The two materials are distinguished by filling of the Bi(Pb)-O antibonding states in the vicinity of the Fermi level, which is responsible for the Bi disproportionation in BiNiO$_3$ at ambient pressure and absence of similar behavior in PbNiO$_3$. The present experiments provide evidence for this conclusion by revealing the presence/absence of Bi/Pb $6s$ states at the top of the valence band in the two materials.