Once Beoplay M5 is connected to your home network (via Wi-Fi or Ethernet), use the Bang & Olufsen app on your mobile device to access the settings of the product and accept the Google Cast terms & conditions.
Google Cast can be enabled at any point via the Bang & Olufsen app by selecting Product settings -> Configure -> Your content -> Google Cast.
The Bang & Olufsen app is available for download here