Martin, 29, a three-time All-Star, hit .211 with 21 homers and 53 RBIs in 133 games last year with the New York Yankees. Martin's batting average has declined in each of the last five seasons after he hit .293 and made his first All-Star game while playing for the Los Angeles Dodgers in 2007.
The signing reunites Martin with right-hander A.J. Burnett. The two played together with the Yankees in 2011 before Burnett was traded to Pittsburgh last spring.
The Pirates were in need of an experienced backstop after declining the club option on Rod Barajas, who struggled in his one season in black-and-gold. Barajas hit .206 with 11 homers in 104 games and struggled defensively, throwing out just 6 percent (6 of 99) potential base stealers.
After a surprising start, Pittsburgh stumbled down the stretch last season. The Pirates finished 79-83.