League sources told MLB Media that Flores' two-year deal is worth $6.25 million. He will earn $3 million in each of the next two seasons, and the contract also includes a $3.5 million club option for the 2022 campaign with a $250,000 buyout.
"The addition of Wilmer Flores gives us great flexibility with his ability to play across the infield," Giants president of baseball operations Farhan Zaidi said in a statement. "Offensively, he matches up well against both right-handed and left-handed pitching and adds another bat to the mix that can help lengthen our lineup."
Flores, 28, recorded a .317 batting average with nine home runs, 18 doubles and 37 RBIs in 89 regular-season games with the Arizona Diamondbacks last season. In six seasons (2013-18) with the Mets, he had a .262 batting average with 68 homers, 253 RBIs and 488 total hits.
The Giants placed right-handed pitcher Reyes Moronta on the 60-day injured list with a right shoulder strain to make room on the 40-man roster.