What game? It matters.
Yes it's possible -- people doing NSF rips basically do the opposite (playing only the music tracks). However, it's long and involved, and kind of a "niche" thing because it requires, on a game-by-game basis. You won't find many (if any at all) romhacking tutorials on this subject. This is what's involved, paraphrased:
1. Reverse-engineering of the game, to figure out where the music playback code/engine is in the game (it may be in multiple places depending on the game) -- this requires extensive 6502 knowledge and general familiarity with the NES, as well as its
audio registers. Many people find the audio aspects of the NES to be very tedious/daunting and tend to avoid it (I myself am one such person),
2. Reverse-engineering the engine itself, and its sequence data format for the music/sound effects. The engine has to be "understood" before it can be analysed further. Every music engine is different, although commercial companies tend to make their own engines and use them throughout games (ex. Capcom had their own, Konami had their own, Nintendo had their own, etc.), and change/tweak them over time (as newer games tended to do different things),
3. Figuring out, safely, what 6502 and/or data needs to be changed in the ROM so that effectively the sequenced music data isn't used but the sound effects are. This is a subset of item #2 above (so more like "#2b" rather than "#3"), and then doing it. This may become complicated if the desire is "disable the music played only in this one part of the game", where the music in question is actually used in several places in the game.
In other words: you really have to understand how the music engine in the game works at the 6502 level, and the data format of the sequence or effects data, to accomplish this.
A good example of the in-depth reverse-engineering of this sort was
done by rainwarrior some time ago for StarTropics. The deep technical details of the reverse-engineering aren't covered in that video, but safe to say Brad had to do all of the above... then again, considering he made and released his own NES game (Lizard) his capability to do it should come as no surprise.
I might suggest posting
in this thread and asking one of the people there who commonly do NSF rips if they could take a look at your thread here for general assistance.
But do not hijack that thread for this project/idea you have here -- that thread has a very specific purpose. People doing NSF rips tend to be quite familiar with game sound engines and may be able to provide technical insights to certain games or certain engines, i.e. User X might have great familiarity with doing NSF rips of Capcom games, while have no experience with Acclaim games, while User Y has the opposite.