The deal is subject to Gonzalez passing a physical exam, which is expected to take place by the end of the week.
The Orioles also agreed to a contract with corner infielder Garrett Atkins, who will get a one-year deal that pays him $4 million next season and includes an option for 2011, according to multiple reports.
Atkins, who turned 30 on Saturday, spent his entire seven-year major league career with the Rockies before he became a free agent last weekend when Colorado failed to offer a 2010 contract.
Atkins slumped to a .226 average with nine homers and 48 RBIs last season after hitting .286 with 21 homers and 99 RBIs in 2008. Atkins, who made $7.05 million, lost the third base job to Ian Stewart by the end of the season.
Atkins had a career-high 29 homers and 120 RBIs in 2006, when he was fourth in the NL with a .329 average. He batted .301 with 25 homers and 111 RBIs the following year.
His deal calls for a $4 million salary next year and includes an $8.5 million club option for 2011 with a $500,000 buyout, according to The Associated Press. There are additional performance bonuses.
Gonzalez, 31, went 5-4 with a 2.42 ERA and 10 saves in 80 appearances with Atlanta last season. He was regarded as one of the top relievers on the market this winter, and will take over as closer in Baltimore. The Orioles have been in need of a closer since trading George Sherrill to the Dodgers this summer, and were looking at Jim Johnson and Koji Uehara as potential candidates before acquiring Gonzalez.
"I feel really comfortable in that position," he said during a news conference at Camden Yards.
Gonzalez has a 14-16 record with 330 strikeouts in 280 2/3 career innings with the Pirates and Braves. His contract includes incentives that could increase his overall payout to $16 million, the source said.
Gonzalez said he is fully recovered from elbow ligament replacement surgery in May 2007. He is eager to pitch in the AL East.
"The switching of leagues, to me, I'm not thinking it's going to be a difference," he said. "The thing that I'm excited about is the division we're going to be playing in. Obviously, everyone knows that this is the toughest division in baseball. To be able to face those lineups, I take it as a challenge."
The Baltimore Sun was first to report that Gonzalez was near a deal with the Orioles.
Jerry Crasnick covers baseball for ESPN Insider. Information from The Associated Press was used in this report.