The nucleon exchange mechanism is investigated in the central collisions of Ca-40+U-238 and Ca-48+U-238 systems near the quasifission regime in the framework of the stochastic mean-field (SMF) approach. Sufficiently below the fusion barrier, a dinuclear structure in the collisions is maintained to a large extent. Consequently, it is possible to describe nucleon exchange as a diffusion process familiar from deep-inelastic collisions. Diffusion coefficients for proton and neutron exchange are determined from the microscopic basis of the SMF approach in the semiclassical framework. Calculations show that after a fast charge equilibration the system drifts toward symmetry over a very long interaction time. Large dispersions of proton and neutron distributions of the produced fragments indicate that the diffusion mechanism may help to populate heavy transuranium elements near the quasifission regime in these collisions.