I've made the trip from Newark to Manhattan numerous times so I have some idea of the logistics, although I've never it on the same day like you are talking about. But it's always a great idea to get out of the airport for a day trip when you can, which I've done at various airports around the globe. With 7 hours I would plan my time as:
- It will probably take you 15 - 30 minutes to exit the plane and walk to the exit to get a taxi
- 1 hour transit each way from Newark to Manhattan. I would take a taxi to make the most use of your time. It will be more expensive then the train and you risk running into some traffic, but the taxi can drop you off and pick you up exactly where you want. So you won't have to waste time waiting on a train, making subway switches and then walking to your location. One hour each way is probably more time than you need, but I wouldn't count on less just to be safe.
- Arrive back at Newark 1.5 hrs before boarding to get through security (pre-check hopefully) and immigration, assuming you don't have bags to check or they are already checked through.
So that will give you 3 - 3.5 hrs to spend in Manhattan. I would definitely do it.