We use real-time time-dependent density functional theory simulations to numerically demonstrate that resonantly-enhanced difference-frequency generation (re-DFG) involving intense ultrashort coherent X-ray pulses can selectively excite core states of atoms in molecules. As a model case, we evaluate the spectral selectivity of re-DFG excitation of the oxygen K-edge by illumination of a single gas-phase water molecule with two-color X-ray pulses of different photon energies and durations. The re-DFG excitation is further probed by a small delayed pulse with central photon energy resonant with the oxygen K-edge peak absorption line. Based on these results, we anticipate that highly selective excitation by re-DFG X-ray nonlinear processes might be achieved in more complex molecular systems and bulk materials by using highly penetrating two-color hard X-ray pulses, with extensive applications.