A Samsung Original Stylus Touch S Pen for Samsung Galaxy Note 4 will not work on a Samsung Galaxy Tab 4
The Samsung Galaxy Tab 4 has a capacitive digitizer; not an active digitizer that the Samsung Original Stylus Touch S Pen requires.
This review states the issue; bold emphasis is mine:
The S Pen is an inductive stylus. The display on the Note has what's called an active digitizer under the glass. When the S Pen gets close to the screen, the magnetic field of the active digitizer induces a current that powers its internal circuitry. Power is passed here just like a wireless charging mat and phone that supports its work, it's just not inducing nearly as much power.
And this too; again bold emphasis is mine:
This is far more accurate than a capacitive stylus could ever be. It's why the S Pen won't work as a stylus on any other phone — it's not an electrical conductor. It's also why the S Pen, or Apple Pen, or Pixel Pen, or Surface Pen, etc. work so much better than a "regular" stylus.