Infect changes the form of damage a creature deals — to players it deals poison counters instead of reducing life totals, and to creatures it deals -1/-1 counters instead of regular damage — but it does not prevent the damage event itself from occurring (CR 702.90b).
Lifelink causes the controller to gain life equal to the amount of damage dealt by the creature (CR 702.15b). Because the damage event still happens (it is simply applied in a modified way), lifelink still sees that damage and triggers its life gain. The two abilities are independent and do not cancel each other out.
It is important to note that when infect damage is dealt to a player, that player does not lose life — they receive poison counters instead. However, lifelink's life gain is based on the damage dealt, not on life lost by the opponent, so the controller still gains life even though the opponent's life total is unchanged (CR 119.3, 702.90b).
Concrete example: You attack with a 3/3 creature that has both lifelink and infect. It deals 3 damage to your opponent. Your opponent receives 3 poison counters (their life total stays the same), and you gain 3 life. Both effects happen from the single damage event.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.