If you plan to take the NJ it is better to just buy a ticket for that train. Even with a Eurail Pass you would still have to pay the accommodation surcharge.
What you can do is book this on www.nightjet.ch. Where you add the passengers there is an option “Discount Cards” where you can add any discounts, passes and other tickets. What you can do there is select “Ticket Schweiz 2. Kl Vorhanden” (Or 1. Kl if you have a 1st class pass). That way you tell OBB that you have a ticket covering the Swiss part of the route.