I would change your itinerary to connect at JFK directly.
If you don't have TSA Precheck, you should arrive at JFK 3 hours before a scheduled int'l flight. If your flight arrives at EWR at 3pm, even with public transportation which is the fastest means outside of a helicopter, you won't arrive by 4pm. Check out Google Maps and see how long it will take.