Hiding applications not active

I created a button for my notch bar/Menu Action Bar that plays/pauses active content (e.g. Netflix in a browser; uses now playing widget). I added a Zoom window under the cursor to bring the active content window forward. If I have other windows open, the active window remains hidden. How can I hide other windows as part of this setup?