The 28-year-old Gosselin hit .277 with 12 doubles, two home runs and 13 RBI in 122 games for Arizona in 2016. He led the majors in both pinch hit appearances (83) and pinch hits (20) last season. Both numbers set new club records.
Gosselin can move around defensively, an asset the Pirates need after versatile Sean Rodriguez left for Atlanta in free agency. Gosselin made 35 appearances at second base, 10 at third base, six at first and three more in the outfield.
Gosselin is a career .283 hitter across four seasons with Atlanta and Arizona.
The 25-year-old Duncan, a right-handed starter, went 9-6 with a 2.33 ERA for Triple-A Indianapolis last season.