Brooklyn Nets edge out New York Knicks