SAN FRANCISCO (AP) — The Pittsburgh Pirates will have the advantage of recent form and revenge motivation when they open a three-game series against the San Francisco Giants on Monday night at AT&T Park.

Pirates right-hander Gerrit Cole (7-7, 4.18 ERA), unbeaten in July, will duel Giants righty Matt Cain (3-8, 5.49), who hasn’t won since May, in a rematch of teams that met in Pittsburgh three weeks ago.

READ MORE: UCSF Lab Worked Quickly To Confirm San Francisco's Omicron Case

The Giants swept that three-game series, bombing Cole for seven runs on 10 hits in 5 1/3 innings in a 13-5 drubbing on June 30.

The Pirates have been better recently. They are 12-5 since the end of the San Francisco series, including a six-game winning streak that ended Saturday in Colorado, though they lost to the Rockies again on Sunday, 13-3.

Cole has allowed just five runs in his past three starts combined, a 19-inning stretch in which he struck out 22 and walked one.

The California native is 3-1 with a 3.21 ERA in five career starts against the Giants.

Facing the Giants means Cole will go head-to-head with his brother-in-law, Giants shortstop Brandon Crawford. The pitcher has dominated the matchup so far, limiting Crawford to a .133 average (2-for-15) with five strikeouts.

Denard Span had a home run off Cole in the earlier meeting in Pittsburgh.

READ MORE: Former Los Gatos Elementary School Teacher Gets 35-Year Prison Term For Child Molestation

Cain did not pitch for the Giants in their three-game sweep. He has started 12 times against the Pirates in his career, going 3-3 with a 3.57 ERA. Cain has not faced Pittsburgh this season.

The veteran once again will be seeking to avoid equaling his career-worst losing streak. He sidestepped an eighth straight loss when he limited the Cleveland Indians to three runs and five hits in six innings in a no-decision in his most recent start.

The Pirates almost surely will play the entire Giants series without outfielder Gregory Polanco, who has a hamstring injury.

With his team just three games behind the National League Central co-leaders, the Chicago Cubs and the Milwaukee Brewers, Pirates general manager Neal Huntington admitted Sunday he will be looking for outfield help at the upcoming trade deadline.

“If there’s something out there that makes sense, we will do that,” Huntington said, before cautioning, “To overpay for what hopefully will be a relatively short down-time (for Polanco) doesn’t make a ton of sense for us, either.”

Polanco or no Polanco, the Giants frankly will be happy to see anybody other than Wil Myers and Hector Sanchez. That duo did daily damage when the San Diego Padres continued their recent dominance of the Giants by winning three of four in San Francisco in a series that ended Sunday.

“It has gone on,” Giants manager Bruce Bochy said of the fact the Giants have lost 17 of their past 23 games against the Padres. “Some things are hard to explain. I wish I could.”

MORE NEWS: UPDATE: 1st U.S. Case Of COVID Omicron Variant Confirmed In San Francisco

Actually, the Giants haven’t done well against pretty much anybody since completing their earlier sweep of the Pirates. They are just 5-11 since leaving Pittsburgh.