We report the analysis of light curves of the eclipsing dwarf nova IP Peg in quiescence. The light curves are dominated by the ellipsoidal variation of the mass-donor star, with additional contributions from the accretion disc and anisotropic emission from the bright spot. A secondary eclipse is visible in the J and H light curves, with 2% and 3% of the flux disappearing at minimum light, respectively. We modeled the observed ellipsoidal variation of the secondary star (including possible illumination effects on its inner face) to find a mass ratio of q = 0.42 and an inclination of i = 84.5°, consistent in the three bands within the uncertainties. Illumination effects are negligible. The secondary is responsible for 83%, 84% and 88% of the flux in J, H and Ks, respectively. We fitted a black body spectrum to the fluxes of the secondary star to find a temperature of Tbb = 3100 ± 500 K and a distance of d = 115 ± 30 pc to the system. We subtracted the contribution of the secondary star and applied 3D eclipse mapping techniques to the resulting light curves to map the surface brightness of a disc with half-opening angle α and a circular rim at the radius of the bright spot. The eclipse maps show enhanced emission along the stream trajectory ahead of the bright spot position, providing evidence of gas stream overflow. The inferred radial brightness-temperature distribution in the disc is flat for R < 0.3 RL1 with temperatures 3500 K and colors consistent with those of cool opaque radiators.