Response theory for locally gapped systems