I control Stonehorn Chanter, which has lifelink.
If Stonehorn Chanter deals damage to an opposing player, do I gain life?
If Stonehorn Chanter deals damage to an opposing creature, do I gain life?
When a creature with lifelink deals damage to anything (creature, planeswalker, or player) with any cause (spell, ability or combat), you gain that much life. That means that yes, dealing damage to a blocking creature in combat makes you gain life from lifelink. Rule 702.15b says
Damage dealt by a source with lifelink causes that source’s controller, or its owner if it has no controller, to gain that much life (in addition to any other results that damage causes). See rule 119.3.