Now, you obviously can't prevent these people from doing that without disabling corporate accounts and door access between 5pm-9am. So there will be people doing that, to appear in better light than others. The practice just spreads to less ambitious employees as well, and then to less motivated ones.
While I support that you should be able to cut off work after the day is done and switch to your free time I don't see how you could regulate something like that.
To even try you would have to ban giving promotions to people who work some extra for their employer (remove the incentive to do extra) or give some sort of employment protection to people who do disconnect (pretty much like you can't fire an employee who's pregnant or on parental leave because such is collectively agreed to be worth some serious shitstorm).
In the end, the only enforcement I can think of is that each person needs to make that decision themselves. If they value their free time and life outside work then they must equally deprioritise work in their life, to the extent where they might be fired because they will disconnect from work outside of the hours agreed, and then find an employer who shares the same values. If good employees do that, employers will have to realise that in order to retain or get good employees they must give in and let the employees enjoy their free time in peace. Now, the only problem is that there is always someone more hungry for money than you, willing to sacrifice more than you. The remaining question is that which people are the majority.