You have two subway alternatives. Take the Airtrain from your terminal to Jamaica station:
1. Take the E subway to Forest Hills, transfer to the G subway to Nassau Ave. That station is at Nassau & Manhattan Aves. on the border of N. Williamsburg and Greenpoint.
2. Take the J subway to Marcy Ave. That station is at Marcy & Broadway in the heart of Williamsburg.
Either will cost $7.25 total. My guess is #1 would be the best.
You have two subway