As I recall, there is a lip on each side of the valve which fits into the hub of the pipe connections. It is not too big but I recall it hangs up unless you can get the drain pipe to clear.
You don't say what year and model Montana you have, but usually you can cut the sewer pipe downstream from the Y connection (which ties in the black and grey tank drain lines). Cut out about an inch of pipe and then you can get clearance to remove the valve easily. It also helps when reinstalling and to not let the seals move causing more problems. Use a 3" no-hub flexible connector to cover the cut area. Doing this also gives a little flex to the drain lines and may prevent future cracking of the spud on the tanks and causing a more difficult to repair leak.
Carl (n Susan) Youngren
There is more to life than fuel mileage.
2012 Montana 3700RL Big Sky Package towed by a 2015 Ford F350 6.7L PSD 4WD CC LWB