Gamma band rhythms may synchronize distributed cell assemblies to facilitate information transfer within and across brain areas, yet their underlying mechanisms remain hotly debated. Most circuit models pose that soma-targeting parvalbumin (PV) positive GABAergic neurons are the essential inhibitory neuron subtype necessary for gamma rhythms. Using cell-type specific optogenetic manipulations in behaving animals, we show that dendrite-targeting somatostatin (SOM) interneurons are critical for a visually induced, context-dependent gamma rhythm in the visual cortex (V1). A novel computational model independently predicts that context-dependent gamma rhythms depend critically on SOM interneurons. Further in vivo experiments show that SOM neurons are required for long distance coherence across V1. Taken together, these data establish a new mechanism for synchronizing distributed networks in the visual cortex. By operating through dendritic and not just somatic inhibition, SOM-mediated oscillations may expand the computational power of gamma rhythms for optimizing the synthesis and storage of visual perceptions.