You should take the AirTrain JFK service from the airport to the nearest public transit station in New York City. Tickets are currently priced at $5. Once aboard the AirTrain, take it until Jamaica station. Then transfer to the LIRR system and travel until NYC's Penn Station. Once you have arrived at the train station, you may use either AMTRAK's rail service, or that offered by NJ Transit to travel on to Newark.