Chad Qualls and Ryan Theriot also joined the playoff chase and Ryan Church highlighted a five-player swap between last-place teams.
The swaps came as clubs scrambled before the 4 p.m. EDT deadline for making trades without waivers.
The NL Central-leading St. Louis Cardinals were the prime players in a three-team trade, getting Westbrook from Cleveland and also sending Ludwick to NL Central-leading San Diego.
"I'm excited to go to a club that's contending for a playoff spot and pitch in some meaningful ballgames," Westbrook said. "That's why you play the game, to get a chance to play in the playoffs and I look forward to doing that."
The 32-year-old righty was 6-7 with a 4.65 ERA for Cleveland. Ludwick, a 32-year-old outfielder, hit .281 with 11 home runs and 43 RBIs this season.
Cleveland sent cash to the Cardinals and Padres, and got minor league pitcher Corey Kluber from San Diego - the 24-year-old righty led the Texas League in strikeouts. St. Louis also acquired minor league lefty Nick Greenwood from San Diego.
The Los Angeles Dodgers got the left-handed Lilly, Theriot and about $2.5 million from the Chicago Cubs for infielder Blake DeWitt and minor league right-handers Kyle Smit and Brett Wallach.
"We've been looking to improve our rotation and with Ted, we feel like we've got a very good group of starting pitchers for the stretch run," Dodgers general manager Ned Colletti said. "Ryan is versatile and can help us in the middle of the diamond as a nice complement to our existing infielders."
Los Angeles began the day in third place in the NL West, seven games behind San Diego.
The World Series champion Yankees finished off their deal to get Berkman from Houston. A five-time All-Star, the first baseman becomes New York's designated hitter.
Houston sent $4 million with Berkman to the Yankees, and got reliever Mark Melancon and minor league infielder Jimmy Paredes in return.
The Arizona Diamondbacks were busy, trading reliever Chad Qualls to the contending Tampa Bay Rays for a player to be named and making a multiplayer swap with Pittsburgh.
Qualls, a 31-year-old right-hander, was 1-4 with 12 saves and an 8.29 ERA this season.
Arizona sent catcher Chris Snyder, minor league shortstop Pedro Ciriaco and cash to the Pirates for outfielder Church, former AL Rookie of the Year Bobby Crosby and right-hander D.J. Carrasco.
Earlier this week, Houston traded ace Roy Oswalt to Philadelphia, Cleveland sent outfielder Austin Kearns to the Yankees and Kansas City moved outfielder Scott Podsednik to the Dodgers.
Teams can still make trades for the rest of the season, but it gets more tricky. Players must first pass through waivers, meaning any club can get an opportunity to claim them before a deal is done.
Deals must be completed before Aug. 31 for a player to be eligible for the postseason with his new team.