We tested the sensory impact of repeated synchronization of fast-spiking interneurons (FS), an activity pattern thought to underlie neocortical gamma oscillations. We optogenetically drove 'FS-gamma' while mice detected naturalistic vibrissal stimuli and found enhanced detection of less salient stimuli and impaired detection of more salient ones. Prior studies have predicted that the benefit of FS-gamma is generated when sensory neocortical excitation arrives in a specific temporal window 20-25 ms after FS synchronization. To systematically test this prediction, we aligned periodic tactile and optogenetic stimulation. We found that the detection of less salient stimuli was improved only when peripheral drive led to the arrival of excitation 20-25 ms after synchronization and that other temporal alignments either had no effects or impaired detection. These results provide causal evidence that FS-gamma can enhance processing of less salient stimuli, those that benefit from the allocation of attention.