A more isolated way, install wayland compositor in container, use host wayland socket as backend, start the untrusted app in container wayland compositor.
Note: Desktop environment here is in broad sense. For me a desktop environment is a desktop environment if there is a X11 window manager or wayland compositor with other gui programs. Desktop environment in narrow sense is something like Gnome, Kde, Xfce, etc.
required:
a linux host can run container (lxd, incus, lxc, docker)
a working graphic card
a working sound card
a working network card
Warning: running DE in container is not perfect. You will encounter a lot of tech issues and bugs…