CHICAGO — Jason Heyward hit a tie-breaking sacrifice fly in the eighth inning Friday, and the Chicago Cubs snapped a six-game losing streak with a 3-2 victory against the St. Louis Cardinals.

Heyward also had an RBI double in the sixth and Kris Bryant homered as the Cubs washed away some of the sting from a winless trip against the Dodgers and Padres. Anthony Rizzo reached four times and scored two runs, a day after he got engaged.

Rizzo led off the eighth with a double over the head of rookie left fielder Magneuris Sierra. He moved up on Ben Zobrist’s grounder to third and scampered home when Heyward hit a fly ball to center against Trevor Rosenthal (1-2).

Pedro Strop (1-2) struck out Yadier Molina with the bases loaded for the final out of the Cardinals’ eighth, and Wade Davis finished for his 11th save.

GIANTS 10, PHILLIES 0: Ty Blach tossed his first career shutout and became the first pitcher in eight years to walk three times, Denard Span had five hits and San Francisco won at Philadelphia.

Blach (4-2) scattered seven hits, struck out four and didn’t walk a batter to win his fourth consecutive start.

REDS 3, BRAVES 2: Eugenio Suarez scored the tying run in the ninth inning on Jim Johnson’s wild pitch, and Devin Mesoraco led off the 10th with a homer, rallying Cincinnati at home.

Mesoraco, who got into the game as a defensive replacement in the 10th, connected off Jose Ramirez (2-2) for his first career game-ending homer. Raisel Iglesias (2-0) faced three batters in the top of the 10th.

MARLINS 7, DIAMONDBACKS 5: Giancarlo Stanton matched a career high by scoring three times, and his 15th home run of the season put Miami ahead for good at home.

Justin Bour and Christian Yelich each hit two-run homers in the first for Miami, which improved to 6-2 on this homestand. J.T. Realmuto had two hits and scored twice for the Marlins.

PIRATES 12, METS 7: Elias Diaz hit his first major league homer and drove in six runs, lifting Pittsburgh at New York.

Diaz hit a go-ahead, three-run shot off reliever Paul Sewald (0-1) during a seven-run sixth inning. Pittsburgh led 11-7 when New York finally retired the side.

AMERICAN LEAGUE

TIGERS 15, WHITE SOX 5: Miguel Cabrera had his 1,000th career extra-base hit, J.D. Martinez fell a single short of the cycle and Detroit won at home.

Cabrera and Martinez combined for five hits, all for extra bases, and six RBI in eight at-bats. John Hicks and Mikie Mahtook also homered for Detroit.

BLUE JAYS 7, YANKEES 5: Josh Donaldson hit two solo home runs, Francisco Liriano won in his return from the disabled list and Toronto won at home.

Justin Smoak added his team-leading 13th homer, a two-run drive in Toronto’s three-run first inning. He drove in three runs.

ROYALS 5, INDIANS 0: Jason Vargas tossed his first shutout in nearly three years as Kansas City won at home.

It was his first shutout since a 3-0 win over Oakland on Aug. 13, 2014.