4 Hours, Its doable. But I do recommend that you ocntact the airline and check if you can leave from JFK or LGA instead..
* Fastest way to EWR is to arrange a taxi - yes its expensive but is for sure.
* Another way is Bus and I believe its $17.00 - But they make stops in LaGuardia, Pen station, then Newark.
Your call.
4 Hours, Its doable. But I