PITTSBURGH -- Major League Baseball's hottest rivalry kept its boiling point Sunday night, when Gregory Polanco's bases-loaded single with two outs in the 10th capped a three-run rally and gave the Pirates a 6-5 win over the Cardinals. Randal Grichuk's two-run double in the top of the 10th had given the Cards a 5-3 lead. Singles by Starling Marte and Francisco Cervelli off Trevor Rosenthal knotted the score to set the stage for Polanco.

"To get three off an All-Star closer ..." Pirates manager Clint Hurdle marveled about his never-say-die crew. "For our guys to even show up after spotting them two -- incredible things happen when you get a group of men together with one common goal."

Video: [email protected]: Cervelli ties game in 10th with RBI single

Most remarkably, following a leadoff single by Jordy Mercer, Rosenthal retired both hot-hitting Neil Walker and Saturday night walk-off hero Andrew McCutchen before some lesser-profile bats got him.

"I don't know if he let off the gas a little bit," Walker said of Rosenthal, "but we ground him down pretty good there. Marte got a big hit and it quietly built to a game-winning hit, and it was just awesome."

Video: [email protected]: Marte knocks in Mercer with single to right

This was the season's 10th game between the division rivals, and the fifth to go extra innings. The teams have split the 10 games, and a third straight victory Sunday moved the Bucs within 2 1/2 games of the Cardinals' National League Central lead entering the All-Star Game break.

Pirates starter Francisco Liriano departed after 6 1/3 innings with a 3-2 lead, arranged mostly on his own two-run single in the second off Tim Cooney, the Cardinals' rookie lefty who went five innings.

MOMENTS THAT MATTERED

Jhonny be good: Prior to Sunday's game, Cardinals manager Mike Matheny compared Jhonny Peralta to Carlos Beltran -- both are as steady as they come. And Peralta, a hot hitter through the first half of the season, built on his consistency at the plate with a solo home run to left-center field in the top of the third inning. It was Peralta's 13th homer of 2015.

Video: [email protected]: Peralta ties game at 2 with solo shot in 3rd

Liriano connects: With the tying run on third and two outs in the second inning, the Cardinals had a choice of having Cooney pitch to either Polanco (5-for-44 versus southpaws) or to Liriano (2-for-35 against everyone) and made the wrong one. Polanco was issued an intentional walk, then Liriano singled to score both runners and give the Bucs an early 2-1 lead.

Video: [email protected]: Liriano lines a two-run single to right

"I knew he'd throw a fastball, so I went up there ready to swing," said Liriano, who doubled his previous career total of two RBIs. "Mostly they will throw first-pitch fastballs against pitchers, so I was trying to put a good swing on it and got it done today."

Big trouble, little damage: Pirates reliever Tony Watson got himself into a big mess in the eighth -- with a little help from Mercer -- and mostly got himself out of it. Protecting a one-run lead, he let the Cards load the bases with none out by hitting Kolten Wong, allowing a Peralta single and seeing Jason Heyward's bouncer to short bobbled by Mercer for an error. But Watson held the Cards to one run, on a scoring grounder by Yadier Molina, keeping the game tied at 3.

Video: [email protected]: Watson escapes a bases-loaded jam in the 8th

QUOTABLE

"That's ridiculous. It's July. It's early July. ... That's so far away. We've got a lot of baseball to play." -- Matheny, on early talk of a Cardinals-Pirates playoff series.

"Last night's was a classic game ... the kind of game you watch 10 years from now. And now you back it up with another one." -- Hurdle, on the Pirates following Saturday night's 14-inning win with Sunday night's 10-inning win, both by 6-5 scores after they trailed entering the bottom of the last innings.

SOUND SMART WITH YOUR FRIENDS

The Pirates improved to 19-6 this season at PNC Park in front of crowds of 33,000-plus.

WHAT'S NEXT

Cardinals: After starters Michael Wacha and Carlos Martinez take part in All-Star Game activities, the focus on St. Louis' rotation shifts to Lance Lynn. The 28-year-old will start the Cardinals' first game of the second half of the season Friday at 7:15 p.m. CT against the Mets at Busch Stadium. Lynn's last outing was one to forget, surrendering five runs to the Pirates in four innings -- his shortest outing since June 28, 2014.

Pirates: The Bucs will come out of the four-day All-Star Game break by opening a six-game trip with the first of three in Milwaukee. Charlie Morton will lead it off Friday at 8:10 p.m. ET. It will kick off a challenging part of the schedule that will have the Pirates on the road for 12 of the first 16 second-half games.

Watch every out-of-market regular season game live on MLB.TV.