Red Sox president of baseball operations Dave Dombrowski announced the deal on Thursday. Pearce, 35, is a 12-year veteran and a career .255 hitter. He played for the Pittsburgh Pirates, Baltimore Orioles, Houston Astros, New York Yankees and Tampa Bay Rays before joining the Blue Jays in 2016. He also had a brief stint with the Minnesota Twins.
"We've been looking for a guy that can hit against left-handed pitching," Dombrowski told reporters. "Even though we have swung the bat better in recent times. We still have talked about trying to have one more guy that we could put in the lineup versus a tough left-hander."
Pearce was originally drafted by the Red Sox in the 10th round of the 2004 amateur draft, but did not sign with the team. He signed with the Pirates after being taken in the eighth round of the 2005 amateur draft.
The first baseman/outfielder was hitting .291 with four home runs and 16 RBIs in 26 games this season for the Blue Jays.
Espinal, 23, has never appeared in a Major League Baseball game. He hit .313 with seven homers and 32 RBIs in 65 games this season for the Salem Red Sox, a Minor League Class A Advanced affiliate of the Red Sox.
Pearce is expected to join the team this weekend.
"He's a good player," Red Sox manager Alex Cora said. "He is swinging the bat well. He gives an option against lefties. He can play first. He can play the outfield. He can DH. He can come off the bench and pinch hit. It's one more weapon that we have."
"We got better tonight."
The Red Sox battle the Yankees at 7:05 p.m. Friday at Yankee Stadium in New York. The three-game rivalry series wraps up on Sunday and will briefly determine who leads the American League East race entering July.