Interaction of the laser radiation with magnetic nanostructures continuously attracts high research interest. This issue concerns the studies of surface-driven mechanisms of the magneto-optical response of multicomponent structures composed of magnetic and nonmagnetic specimen. Here we study the magnetizationinduced optical second-harmonic generation in its relation to the magnetization dynamics induced in bilayer ferromagnetic/heavy metal nanofilms by the magnetic field of an intense femtosecond laser pulse. We show the appearance of odd in magnetization intensity effect in the second-harmonic generation (SHG), which correlates with the damping of the magnetization oscillations at the optical wave frequency as was predicted quite recently. The efficiency of the effect is of a few percent as compared to the nonmagnetic SHG and is the most pronounced for the so-called "forbidden" SHG geometry, i.e., for the p-polarized incident and reflected waves in the longitudinal magnetization scheme. This magnetization-dynamics-induced SHG contribution is shown to be anisotropic, sensitive to the angle of incidence of the probe beam, and is the largest for the CoPt films due to the maximum Gilbert damping constant.