Explaining the mechanism of superconductivity in the high-$T_c$ cuprates requires an understanding of what causes electrons to form Cooper pairs. Pairing can be mediated by phonons, the screened Coulomb force, spin or charge fluctuations, excitons, or by a combination of these. An excitonic pairing mechanism has been postulated, but experimental evidence for coupling between conduction electrons and excitons in the cuprates is sporadic. Here we use resonant inelastic x-ray scattering (RIXS) to monitor the temperature dependence of the $underline{d}d$ exciton spectrum of Bi$_2$Sr$_2$CaCu$_2$O$_{8-x}$ (Bi-2212) crystals with different charge carrier concentrations. We observe a significant change of the $underline{d}d$ exciton spectra when the materials pass from the normal state into the superconductor state. From theoretical modeling, we determine the strength of the coupling between the electrons and the excitons. Our observations show that the coupling to excitons can be strong enough to play an important role in stabilizing the superconducting state.