A five-year-old legal battle between San Francisco Baykeeper, a conservation organization, and Dow Chemical ended yesterday when the Contra Costa County Superior Court approved a settlement. Dow stood accused of unlawfully discharging contaminated water into the New York Slough, which empties into the Sacramento-San Joaquin Rivers and from there into the San Francisco Bay. Under the terms of the settlement, Dow will pay $3 million toward a wetland restoration project, and will clean up contaminated groundwater using an innovative new technology. The bioremediation technology involves injecting nutrients into the aquifer to encourage microbes to consume toxic chemicals. The groundwater in the area is currently contaminated with carbon tetrachloride, perchlorethylene, methylene chloride, and trichloroethylene, which are suspected of causing cancer and other health problems.