Use this list of top schools as a guideline of towns to look through. $400k is not going to get you great schools west of Deer Park unless it's a small ranch or cape.
//www.city-data.com/forum/long-...gs-2014-a.html
Look around the Massapequa, Levittown, Bethpage, Bellmore area of the list - they are considered pretty decent schools and you may find a good $400k there. If you can swing the extra distance, try Commack for better schools too.
In any case, beware of the $12k/yr taxes though, which adds $1k/mo. to your mortgage payment.