According to Melzack and Wall's gate-control theory of pain, which of the following mechanisms is responsible for modulating the sensation of pain?