Context. Investigating the dust heating mechanisms in galaxies provides a deeper understanding of how the internal energy balance drives their evolution. Over the last decade radiative transfer simulations based on the Monte Carlo method have emphasised the role of the various stellar populations heating the diffuse dust. Beyond the expected heating through ongoing star formation, older stellar populations (≥8 Gyr) and even active galactic nuclei can both contribute energy to the infrared emission of diffuse dust. Aims. In this particular study we examine how the radiation of an external heating source, such as the less massive galaxy NGC 5195 in the M 51 interacting system, could affect the heating of the diffuse dust of its parent galaxy NGC 5194, and vice versa. Our goal is to quantify the exchange of energy between the two galaxies by mapping the 3D distribution of their radiation field. Methods. We used SKIRT, a state-of-the-art 3D Monte Carlo radiative transfer code, to construct the 3D model of the radiation field of M 51, following the methodology defined in the DustPedia framework. In the interest of modelling, the assumed centre-to-centre distance separation between the two galaxies is ∼10 kpc. Results. Our model is able to reproduce the global spectral energy distribution of the system, and it matches the resolved optical and infrared images fairly well. In total, 40.7% of the intrinsic stellar radiation of the combined system is absorbed by dust. Furthermore, we quantify the contribution of the various dust heating sources in the system, and find that the young stellar population of NGC 5194 is the predominant dust-heating agent, with a global heating fraction of 71.2%. Another 23% is provided by the older stellar population of the same galaxy, while the remaining 5.8% has its origin in NGC 5195. Locally, we find that the regions of NGC 5194 closer to NGC 5195 are significantly affected by the radiation field of the latter, with the absorbed energy fraction rising up to 38%. The contribution of NGC 5195 remains under the percentage level in the outskirts of the disc of NGC 5194. This is the first time that the heating of the diffuse dust by a companion galaxy is quantified in a nearby interacting system.