Lee's agent, Mark Bartelstein, told ESPN.com that Lee has agreed to a sign-and-trade worth $80 million over six years with the Golden State Warriors.
"There was a lot of different ways this could have gone and I needed [the Knicks] to help," Bartelstein said. "They were great about it."
A number of other teams including the Raptors, Suns, Timberwolves and Nets had made pitches to Lee in the past several days.
"David loved his time in New York," Bartelstein said. "They gave David an incredible opportunity the last few years."
Chad Ford covers the NBA for ESPN The Magazine. Information from The Associated Press was used in this report.