I can think of a couple of ways.
You could create two sensor cards with different names and choose which is displayed with either the conditional card or the custom state switch card.
Or you could template the sensor card name with this custom card: 📝 100% Templatable Lovelace Configurations