Not reliably. Immunity from natural infection does fade over time. If it’s been more than ten years since you had whooping cough or a pertussis-containing vaccine, your protection has likely diminished significantly.