Once the Beoplay M5 is connected to your network with via Wi-Fi or Ethernet, use the Bang & Olufsen app on your mobile device to access the settings of the product and accepting the Google Cast terms and conditions. It can be enabled at any point via the Bang & Olufsen app by selecting Product settings - Google Cast.
To disable Google Cast again, you will need to perform a reset. To reset, please see here.