Gravitational coupling between a gaseous disk and an orbiting perturber leads to angular momentum exchange between them which can result in gap opening by planets in protoplanetary disks and clearing of gas by binary supermassive black holes (SMBHs) embedded in accretion disks. Understanding the co-evolution of the disk and the orbit of the perturber in these circumstances requires knowledge of the spatial distribution of the torque exerted by the latter on a highly nonuniform disk. Here we explore disk-satellite interaction in disks with gaps in linear approximation both in Fourier and in physical space, explicitly incorporating the disk non-uniformity in the fluid equations. Density gradients strongly displace the positions of Lindblad resonances in the disk (which often occur at multiple locations), and the waveforms of modes excited close to the gap edge get modified compared to the uniform disk case. The spatial distribution of the excitation torque density is found to be quite different from the existing prescriptions: most of the torque is exerted in a rather narrow region near the gap edge where Lindblad resonances accumulate, followed by an exponential fall-off with the distance from the perturber. Despite these differences, for a given gap profile the full integrated torque exerted on the disk agrees with the conventional uniform disk theory prediction at the level of ~10%. The nonlinearity of the density wave excited by the perturber is shown to decrease as the wave travels out of the gap, slowing down its nonlinear evolution and damping. Our results suggest that gap opening in protoplanetary disks and gas clearing around SMBH binaries can be more efficient than the existing theories predict. They pave the way for self-consistent calculations of the gap structure and the orbital evolution of the perturber using accurate prescription for the torque density behavior.