The transient emission produced behind internal shocks that are driven by overtaking collisions of a magnetized, relativistic outflow is considered. A self-consistent model capable of describing the structure and dynamics of the shocks and the time evolution of the pair and gamma-ray distribution functions is developed and applied to gamma-ray flares in blazars, in the case in which gamma-ray production is dominated by inverse Compton scattering of external radiation. The dependence of the flare properties on magnetic field dissipation rate, the intensity of ambient radiation, and the thickness of expelled fluid slabs is analyzed. It is shown that (1) the type of gamma-ray flare produced by the model is determined by the ratio of the thickness of ejected fluid slab and the gradient length scale of ambient radiation intensity; (2) the radiative efficiency depends sensitively on the opacity contributed by the background radiation, owing to a radiative feedback, and is typically very high for parameters characteristic to the powerful blazars; and (3) the emitted flux is strongly suppressed at energies for which the pair-production optical depth is initially larger than unity; the time lag and flare duration in this energy range increase with increasing gamma-ray energy. At lower energies, flaring at different gamma-ray bands occurs roughly simultaneously but with possibly different amplitudes. Some observational consequences are discussed.