We have performed narrow-band imaging observations with the Very Large Telescope, aimed at detecting the Lyman continuum (LC) flux escaping from galaxies at z~3. We do not find any significant LC flux from our sample of two galaxies in the Hubble Deep Field South, at z=3.170 and 3.275. The corresponding lower limits on the F_{1400}/F_{900} flux density (per Hz) ratio are 15.6 and 10.2 (3-sigma confidence level). After correction for the intergalactic hydrogen absorption, the resulting limits on the relative escape fraction of the LC are compared with those obtained by different approaches, at similar or lower redshifts. One of our two objects has a relative escape fraction lower than the detection reported by Steidel et al. in a composite spectrum of z~3 galaxies. A larger number of objects is required to reach a significant conclusion. Our comparison shows the potential of narrow-band imaging for obtaining the best limit on the relative escape fraction at z~3. Stacking a significant number of galaxies observed through a narrow-band filter would provide constraint on the galactic contribution to the cosmic reionization.