Camby's contract will be for $13.2 million over three years. The Rockets will receive guard Toney Douglas, center Jerome Jordan, forward Josh Harrellson and second-round picks in 2014 and 2015, according to a league source.
The deal cannot be finalized until July 11.
Camby appeared to be narrowing his choices down to the Knicks, Miami Heat and Brooklyn Nets. But after he postponed a meeting with the Heat on Saturday because they used their midlevel exception on Ray Allen, the Knicks were in the lead. The Nets had only a conference call with Camby, while the Knicks had a face-to-face meeting with him in Houston on Sunday, which a source close to the situation said was "very positive."
Camby returns to New York, where he played from 1998 to 2002. He was the starting center on the 1999 team that went to the NBA Finals against the San Antonio Spurs.
Now the Knicks will have arguably the best big man one-two punch with 2012 Defensive Player of the Year Tyson Chandler starting and Camby, who won the award in 2007, backing him up.
Camby averaged 7.1 points and 9.3 rebounds in 19 games last season for the Rockets, who landed the veteran center in a deadline trade with Portland. He becomes the second nearly 40-something to join the Knicks this summer, with Jason Kidd agreeing to go to New York last week.
Douglas played in 38 games last season, starting only nine, and averaged 6.2 points and 2.0 assists. The 6-10, 275-pound Harrelson was a second-round pick by New Orleans in 2011 and was traded to the Knicks. He appeared in 37 games and averaged 4.4 points and 3.9 rebounds. The 7-foot Jordan, a native of Jamaica, averaged 5 minutes in 21 games last season.
Douglas was the Knicks' starter at point guard to begin the season but struggled coming off offseason shoulder surgery. He quickly lost his starting job and eventually fell out of the rotation completely, even after injuries to Jeremy Lin and Baron Davis.
The Knicks and Rockets are also competing for Lin's services. Houston, one of the most active teams in the offseason, got Lin to agree to a four-year deal, but he is a restricted free agent, and the Knicks have three days after Wednesday to match the Rockets' offer.
Jared Zwerling is a contributor to ESPNNewYork.com. ESPNNewYork.com's Ian Begley and information from The Associated Press contributed to this report.