Despite years of intensive research on copper oxide superconductors with high transition temperatures (T c ), the driving force of superconductivity has not yet been clarified. Angle-resolved photoemission spectroscopy (ARPES) 1-3 measurements have uncovered an important contribution of lattice vibrations (phonons) to superconductivity, sparking a fierce debate on the nature of the 'glue' - phonons or magnetic excitations - binding together the superconducting Cooper pairs 1-11 . However, it is difficult to distinguish these two pairing forces owing to their similar energy scales. Here, we propose a fresh approach to investigate the origin of many-body interactions in these superconductors: an impurity-substitution effect on the low-energy dynamics, which is a magnetic analogue of the isotope effect used for classical superconductors. Our ARPES results reveal that the impurity-induced changes in the electron self-energy show a good correspondence to those of magnetic excitations 12-18 , indicating the importance of spin fluctuations to electron pairing in the high-T c superconductors.