I've not tried this myself, but you could try running a second OBS instance in portable mode, using a completely different scene setup just to capture the Discord window and saving to a separate video.
As Koala says, for most flexibility you'd add Discord as its own audio capture source.
You would need to figure out how you want to set up your second capture for Discord audio so it's not included in main game audio. I would recommend thinking whether you want to save Discord audio in the 'main' video of your gaming session or in the separate Discord clip.
If you capture discord audio on a separate channel, along with gaming audio on the main channel, that would ensure discord audio is synchronised to whatever happens in the gaming audio.
But, would you rather save it in the video for your Discord window, so you only have to worry about any absolute synchronisation between Discord and the gaming video while you're editing your videos afterwards? If so, separately capture the Discord audio with the Discord video and save that as one file. Save your game capture as the main video along with just the game audio.
Bear in mind you won't be able to use the NVENC encoder in two OBS instances simultaneously, so one video capture (I'd suggest the OBS portable instance for capturing Discord) would need to use x264 CPU encoding.
The win-capture-audio plugin may help you with capture specific program audio. The plugin does have issues with Windows 11 at the moment I believe.
An alternative method, which I've used for my setup for a long time, is to route all your audio (desktop, games, Discord) through VoiceMeeter. You use a different virtual input to VoiceMeeter as Discord's output device, for example VAIO3 or Aux Input (remember in VoiceMeeter language, "input" is the audio coming from a program into VoiceMeeter) and then route it out of its own VAIO output -- where you can also capture separately in Discord as you want it.
The VoiceMeeter learning curve is steep to begin with, but VoiceMeeter is so powerful and flexible it's worth getting to grips with it.
VoiceMeeter also allows you to record a multichannel audio file from its control panel, which you can import to an editor and extract what you need later, but bear in mind you may have gradual sync issues over time as soon as you start to save audio separately from video.