If an opponent gained life this turn, you may pay {B} rather than pay this spell's mana cost.
Target player loses 5 life and you gain 5 life.
Casting a Trap by paying its alternative cost doesn’t change its mana cost or converted mana cost. The only difference is the cost you actually pay.
Effects that increase or reduce the cost to cast a Trap will apply to whichever cost you chose to pay.
Needlebite Trap’s alternative cost condition checks only whether life was gained. It doesn’t care whether life was also lost. For example, if an opponent gained 4 life and lost 6 life during the turn, that player will have a lower life total than they started the turn with — but you can still cast Needlebite Trap by paying {B}.
You may ignore a Trap’s alternative cost condition and simply cast it for its normal mana cost. This is true even if its alternative cost condition has been met.