The ANTARES telescope is well-suited for detecting astrophysical transient neutrino sources as it can observe a full hemisphere of the sky at all times with a high duty cycle. The background due to atmospheric particles can be drastically reduced, and the point-source sensitivity improved, by selecting a narrow time window around possible neutrino production periods. Blazars, being radio-loud active galactic nuclei with their jets pointing almost directly towards the observer, are particularly attractive potential neutrino point sources, since they are among the most likely sources of the very high-energy cosmic rays. Neutrinos and gamma rays may be produced in hadronic interactions with the surrounding medium. Moreover, blazars generally show high time variability in their light curves at different wavelengths and on various time scales. This paper presents a time-dependent analysis applied to a selection of flaring gamma-ray blazars observed by the FERMI/LAT experiment and by TeV Cherenkov telescopes using five years of ANTARES data taken from 2008 to 2012. The results are compatible with fluctuations of the background. Upper limits on the neutrino fluence have been produced and compared to the measured gamma-ray spectral energy distribution.