The pitchers of Nepenthes rajah, a montane carnivorous plant species from Borneo, are large enough to capture small vertebrates such as rats or lizards, which occasionally drown therein. The interactions of N. rajah with vertebrates, however, are poorly understood, and the potential mechanisms that lure vertebrates to the pitchers are largely unknown. We observed frequent visits (average: one visit per 4.2 h) of both the diurnal tree shrew Tupaia montana and the nocturnal rat Rattus baluensis to pitchers by infrared sensor camera and video recording. Both mammalian species often licked the inner surface of the pitcher lid, which harbours numerous exudate-producing glands. Analysis of volatiles extracted from the secretions of the pitcher lids by gas chromatography coupled to mass spectrometry (GC/MS) revealed 44 volatile compounds, including hydrocarbons, alcohols, esters, ketones and sulphur-containing compounds, which are commonly present in sweet fruit and flower odours. The faeces of small mammals were repeatedly observed inside the pitcher, whereas we found the body of only one Tupaia montana drowned in the 42, vital and reasonably large, surveyed pitchers. Our findings suggest that the N. rajah pitcher makes use of the perceptual biases of rats and tree shrews by emitting volatiles known from fruits. The profits that the plant obtains from the repeated visits of two small mammals, together with the provision of exudates for the mammals, comprise an exceptional case of plant–vertebrate interaction.