Pull 5V using NodeMCU output pins
Simple lazy solution:
You need to pull the RTS up to 5V with some 10k and simply put another NPN from RTS line to ground, which the base (with resistor as usual) goes to the GPIO. GPIO goes high - you have current base, NPN conducts and pulls RTS low. If you want to revert this behavior (say, you send data less frequently, and you don't want to permanently waste base current and pull-up current to keep RTS low), then you use classic 2-transistor circuit, seen many times in laptops.
Smarter &quot;proper&quot; solution to waste less power (revert GPIO input, I assume more often then not you are NOT sending the data over time, which kinda makes sense?):
Look at the pic. Ch1 can be 3.3V or 5V signal, and it will drive 24V load.
R23 is optional, but can't hurt. Notice, that R23 and R24 make a voltage divider, so they have to be at least 1 order a magnitude difference, better two, then its effects can be completely ignored. MOSFETs can be replaced with BJTs (with all necessary changes in resistors surrounding them, such as adding base resistors and removing pull-ups and pull-downs, but principle is the same: N-channel pulls gate of P-channel low, or NPN pulls the base of PNP low).
Briefly about idea: Ch1 goes up, Q19 starts to conduct, the gate of Q20, which was at 24V through the pullup R25, is not pulled low to the ground. Since it's a gate of a P-channel, P-channel opens and supplies 24V out. If Ch1 signal is low, the gate of Q19 is low, Q19 doesn't conduct, so the base of Q20 stays pulled up to 24V. You can apply these principles with your circuits. Again, you can build a similar thing out of BJTs.
In your case you drive RTS - you either supply it with 5V, or you close the valve and it's 0V.