The mechanistic Monte Carlo modeling of biological effects of ionising radiation at sub-cellular and DNA scale requires the accurate simulation of track structures in the biological medium, commonly approximated as liquid water. The formalism of microdosimetry allows one to describe quantitatively the spatial distribution of energy deposition in the irradiated medium, which is known to relate to the deleterious effects in the irradiated cellular targets. The Geant4-DNA extension of the Geant4 open-source and general-purpose Monte Carlo simulation toolkit has been recently evaluated for the simulation of microdosimetry spectra, allowing, in particular, the calculation of lineal energy distributions. In this work, we extend the microdosimetric functionalities of Geant4-DNA by the development of a new Geant4-DNA example dedicated to the simulation of differential proximity functions. Simulation results are presented for the proximity function of electrons, protons, and alpha particles over a wide energy range using the different physical models of electron interactions available in Geant4-DNA. The influence of sub-excitation processes and electron tracking cut is discussed. Results are compared to literature data when available. As an example, a simple calculation of the relative biological effectiveness (RBE) in the context of the Theory of Dual Radiation Action using the present proximity functions yields up to a factor of 2 variation of the electron RBE in the energy range from 100 eV to 100 keV.