Gamma band synchronization can facilitate local and long-range neural communication. In the primary visual cortex, visual stimulus properties within a specific location determine local synchronization strength, while the match of stimulus properties between distant locations controls long-range synchronization. The neural basis for the differential control of local and global gamma band synchronization is unknown. Combining electrophysiology, optogenetics, and computational modeling, we found that VIP disinhibitory interneurons in mouse cortex linearly scale gamma power locally without changing its stimulus tuning. Conversely, they suppress long-range synchronization when two regions process non-matched stimuli, tuning gamma coherence globally. Modeling shows that like-to-like connectivity across space and specific VIP→SST inhibition capture these opposing effects. VIP neurons thus differentially impact local and global properties of gamma rhythms depending on visual stimulus statistics. They may thereby construct gamma-band filters for spatially extended but continuous image features, such as contours, facilitating the downstream generation of coherent visual percepts.