The galaxy NGC1512 is interacting with the smaller galaxy NGC1510 and shows a peculiar morphology, characterised by two extended arms immersed in an HI disc whose size is about four times larger than the optical diameter of NGC1512. For the first time we performed a deep X-ray observation of the galaxies NGC1512 and NGC1510 with XMM-Newton to gain information on the population of X-ray sources and diffuse emission in a system of interacting galaxies. We identified and classified the sources detected in the XMM-Newton field of view by means of spectral analysis, hardness-ratios calculated with a Bayesian method, X-ray variability, and cross-correlations with catalogues in optical, infrared, and radio wavelengths. We also made use of archival Swift (X-ray) and Australia Telescope Compact Array (radio) data to better constrain the nature of the sources detected with XMM-Newton. We detected 106 sources in the energy range of 0.2-12 keV, out of which 15 are located within the D_25 regions of NGC1512 and NGC1510 and at least six sources coincide with the extended arms. We identified and classified six background objects and six foreground stars. We discussed the nature of a source within the D_25 ellipse of NGC1512, whose properties indicate a quasi-stellar object or an intermediate ultra-luminous X-ray source. Taking into account the contribution of low-mass X-ray binaries and active galactic nuclei, the number of high-mass X-ray binaries detected within the D_25 region of NGC1512 is consistent with the star formation rate obtained in previous works based on radio, infrared optical, and UV wavelengths. We detected diffuse X-ray emission from the interior region of NGC1512 with a plasma temperature of kT=0.68(0.31-0.87) keV and a 0.3-10 keV X-ray luminosity of 1.3E38 erg/s, after correcting for unresolved discrete sources.