We study the global existence and long-time behavior of solutions of the initial-value problem for the cubic nonlinear Schr\" odinger equation with an attractive localized potential and a time-dependent nonlinearity coefficient. For small initial data, we show under some non-degeneracy assumptions that the solution approaches the profile of the ground state and decays in time like $t^{-1/4}$. The decay is due to resonant coupling between the ground state and the radiation field induced by the time-dependent nonlinearity coefficient.