The NCAA rules are found in all kinds of nooks and crannies, so there's always room for question.
That said, everything I've seen refers to the eligibility of the athlete, without reference to the team. Five years to compete four seasons is the rule. The exceptions to the rule are greyshirt years, Olympic redshirt years, military service, religious missions, and however many hardship years the NCAA is willing to grant in the event of injury or (evidently) something out of the athlete's control. And 2020-21, the COVID year that didn't count. A couple of years ago on The Mat forum I posted that someone entering college in the right year could stretch a career out over 12 years, without military or religious service. But transferring from one school to another doesn't stop the "five-year" clock.