It checks the number of cards in your hand at the beginning of upkeep, and if you have 4 or fewer cards in hand it will not trigger. It checks again when it resolves and will not deal damage unless you still have 5 or more cards in hand.