I know that most special abilities or effects linked to an attack whose damage is entirely negated don't trigger, but does the attack still count as a hit in the first place with regard to abilities such as the combat feat Hammer the Gap?
Yes, you "hit" but do not "deal damage."
The abilities which are negated due to not overcoming DR are those which have some effect correlated with damage. Poisons are a good example of this - if you don't actually make a wound, how are you going to poison them?
However, feats and abilities which are not negated if no damage is done, such as Hammer the Gap, are usually those which rely more on the act of actually hitting, rather than the effect. You can imagine Hammer the Gap being sort of "getting into a steady rhythm" with your strikes, even if no damage is done. (Like a boxer training on a punching bag.)
At GM Discretion.
Damage Reduction reads:
Whenever damage reduction completely negates the damage from an attack, it also negates most special effects that accompany the attack, such as injury poison, a monk's stunning, and injury-based disease. Damage Reduction does not negate touch attacks, energy damage dealt along with an attack, or energy drains. Nor does it affect poisons or diseases delivered by inhalation, ingestion, or contact.
Attacks that deal no damage because of the target's damage reduction do not disrupt spells.
For purposes of Hammer the Gap, it just requires you hit, so I'd say it's fine. Obviously there's GM interpretation here of what "most special effects" means, so there is no RAW-perfect answer except your GM's ruling.