St. Louis also received a conditional 2022 draft pick from Ottawa.
Sanford had 10 goals and 16 points in 52 games for the Blues last season.
"We expect Zach's addition to prove beneficial for us in a number of ways," Senators general manager Pierre Dorion said in a release. "He's a big man who skates well, a power forward who plays with energy and a former Stanley Cup winner. As someone who's had a 16-goal season, he's very capable of contributing offensively, too."
The 26-year-old Sanford has 38 goals and 36 assists in 209 career games with St. Louis and Washington. He helped the Blues win the Stanley Cup in 2019, when they outlasted the Boston Bruins in seven games.
The conditional draft pick is removed from the deal if Brown plays more than 30 NHL games this season.
Brown, the son of former Blues defenseman Jeff Brown, has one goal and nine points in 30 career games -- all with Ottawa. He was selected by the Senators with the No. 11 pick in the 2016 NHL draft.
Of course, trade speculation continues to buzz around the Blues with regards to a more high-profile player, Vladimir Tarasenko. The star winger is in training camp with the club and has maintained that he doesn't want to be a distraction, despite a lingering trade request from the offseason.
The Blues open the preseason on Saturday night, while the Senators begin on Sunday.
The Associated Press contributed to this report.