From Mt. Rushmore to Yellowstone, I agree that Devil's Tower would be a good stop if the weather is relatively clear.
Yellowstone roads will probably still be open, but an early snow might cause the park service to close things for the season, so stay flexible. There is no direct way from the East and NE entrances to the south side of the park if the park is closed. Even if some of the interior roads close early, the road from the NE entrance to the N entrance (Mammoth) is a road they try to keep open, IIRC. If all roads are fully open and you want to walk some trails, etc., 4 days might not give you enough time, but it should be a good time of year to be there.
If facilities in YNP are going to be closed when you arrive but roads are open, I would probably try for 2 nights around Mammoth/Gardiner and 2 nights at Flagg Ranch (just south of the park).
YNP almost touches GTNP. From the South Entrance of YNP to Jackson Lake (GTNP) is probably less than 30 minutes. East of GTNP (less than 10 miles) was a great lodge we stayed at last time we were in the area, Togwotee (I think I spelled correctly). From either Togwotee or Flagg Ranch you could cover GTNP without much difficulty.
There are several other threads about YNP and GTNP and Jackson, so unless you have difficulty finding them, I won't repeat a lot of what is in them.
Your map routes you to the West side of GTNP. You really want to approach from the east side (Jackson Lake, Jenny Lake, Snake River, etc.). I am not even sure there is a road entrance on the west side.
From Jackson heading south, it would be fairly easy to go by Dinosaur National Monument (and avoid SLC).
Good luck.