"I never thought in a million years it would happen, being a lifelong Houston Astro," said Berkman, who is hitting .245 with 13 home runs and 49 RBIs in 85 games this season.
"I'm obviously a little sad to be leaving an organization that gave me my first chance to play in the big leagues, and I had a lot of great years there.
"But I'm very, very excited and happy to be here.
"It's a great situation. I mean, who doesn't want to play for the Yankees?"
The Yankees also acquired closer Kerry Wood and outfielder Austin Kearns in two separate agreements with the Cleveland Indians, who also sent Jake Westbrook to the St. Louis Cardinals as part of a three-team trade with the San Diego Padres.
Cardinals' outfielder Ryan Ludwick has moved from St. Louis to San Diego, with the Padres sending a prospect to both St. Louis and Cleveland.
Wood, a former starter with the Cubs before becoming a full-time reliever with Cleveland, is 1-4 with a 6.30 ERA in 23 relief appearances this season.
Kearns is hitting .272 with eight home runs and 42 RBIs in 84 games this season.
"You measure for your team needs," Yankees general manager Brian Cashman told reporters.
"As I approached the deadline here, I was looking to see if I could secure players that were upgrades over what we currently had. We feel that all of these do that."
Westbrook, who will boost the Cardinals' rotation for the playoff push, is 6-7 with a 4.65 ERA in 21 starts this season, while Ludwick, an All-Star in 2008, is hitting .281 with 11 home runs, 43 RBIs and 44 runs scored in 77 games.
"I'm excited to go to a club contending for a playoff spot and pitch in some meaningful ballgames," Westbrook said.
"That's why you play the game, for a chance to get into the playoffs, and I'm looking forward to doing that."
(Reporting by Mike Mouat in Windsor, Ontario; Editing by Greg Stutchbury)