Does something count as “dealing damage” if its damage is reduced to zero?

An example of a feature where this sort of thing matters is the Optional Favored Foe feature for the Ranger from Tasha’s Cauldron of Everything (emphasis mine):

[…] The first time on each of your turns that you hit the favored enemy and deal damage to it, including when you mark it, you can increase that damage by 1d4. […]

This clearly means that if you hit with an attack that never deals damage, you would not trigger Favored Foe, but what happens if you hit with an attack that can deal damage but that damage was reduced to zero by either damage reduction, resistance, immunity or some other sort of feature; have you still dealt damage?

This question is different from the following:

  • Does dealing 0 damage to a concentrating spellcaster require a saving throw?

As Constitution saving throws result from a creature taking damage, not from a creature dealing damage.