We have analyzed the data on J /ψ-to-Drell-Yan production cross-section ratios in proton-nucleus (p + A) and nucleus-nucleus (A + A) collisions, measured by the NA50 Collaboration in the CERN Super Proton Synchrotron energy domain. The adapted version of the two-component QVZ model [J. Qiu, J. P. Vary, and X. Zhang, Nucl. Phys. A 698, 571 (2002); , Phys. Rev. Lett. 88, 232301 (2002)] has been employed to calculate J /ψ production cross sections. For both J /ψ and Drell-Yan production, nuclear modifications to the free nucleon structure functions are taken into account. In heavy-ion collisions, such modifications are assumed to be proportional to the local nuclear density resulting in centrality-dependent initial state effects. Differences in quark and gluon shadowing lead to a new source of impact parameter dependence of the J /ψ-to-Drell-Yan production ratio. For J /ψ, the final state interaction of the produced cc pairs with the nuclear medium is also taken into account. A satisfactory description of the data in both p + A and A + A collisions is obtained. The role of the shadowing corrections is investigated in detail. Model calculations are extrapolated to predict the centrality dependence of the J /ψ-to-Drell-Yan ratio in the GSI Facility for Antiproton and Ion Research energy regime.