Goldschmidt was 8-for-15 with four homers, two doubles, a triple and seven RBIs when the Diamondbacks swept a three-game weekend series in Colorado to regain a small cushion at the top of the National League West standings, something they lost during a 2-15 skid in which the offense scuffled.
The Diamondbacks will take a 2 1/2-game division lead into a seven-game homestand that begins Monday with the first game of a three-game series against Pittsburgh. Arizona left-hander Patrick Corbin is set to face Pirates right-hander Joe Musgrove in the first game.
Goldschmidt, the only NL position player to make the last five All-Star teams, is 19-for-40 with six doubles, six homers and 12 RBIs in his last 10 games since getting a day off May 29. He was 10-for-63 during the 2-15 slide when the Diamondbacks fell out of first place for the first time this season.
"From where I couldn't hit anything, barely get a hit (if) the ball is on a tee, now hitting a lot of balls hard," Goldschmidt told Fox Sports Arizona after a two-homer game Friday, the first of two straight two-homer games.
"This game is crazy. I don't really know what's happened. Just try to show up and work hard and prepare every day, and whatever the results are they are. You can't really control them. You're just trying to have good at-bats, hit the ball hard, swing at the right pitches. Sometimes it comes in bunches like this. Other times strikeouts and double plays.
"It's an up and down game for sure."
Goldschmidt set a franchise record with four straight games of three hits or more that ended with a two-hit game Sunday, and his two straight two-homer games also was a franchise record.
Ketel Marte homered Sunday, his 10th straight hit for extra bases to tie another team record. He was 4-for-9 with two doubles and a homer against the Rockies. He had three RBIs in the 8-3 victory Sunday.
"He's in a very good spot, as is this entire team," Diamondbacks manager Torey Lovullo said Sunday.
The Pirates have lost seven straight series and are 6-16 since reaching a season-high nine games above .500 after a victory over the San Diego Padres on May 17. They have been shut out four times in the last 13 games, and Josh Bell was dropped from the cleanup spot to sixth in the order the last two games.
Pirates catcher Francisco Cervelli, who was removed from Saturday's game after being struck in the jaw by a foul tip, did not play in the 7-1 victory over the Chicago Cubs on Sunday.
"It's good to win a game," Pirates manager Clint Hurdle told reporters. "We're more surprised when we don't win than when we do win. That's not going to change. These men go out there and they expect to win. They have to play well to win. We played well today."
Arizona outfielder Jon Jay will make his first appearance at home after being acquired from Kansas City for two minor league pitchers Thursday. He is 0-for-8 while hitting leadoff his first three games. He has been hit by a pitch twice.
Jay was hitting .307 with nine doubles, one homer, 18 RBIs and three stolen bases in his first season with the Royals. He had his best years with St. Louis, where he was a .287 hitter with a .354 on-base percentage in six seasons while hitting mostly first or second in the order.
"Makes contact. Professional hitter," Arizona right-hander Zack Greinke told reporters. "He's one of those St. Louis Cardinal guys. If you get him out one way a couple of times, they can make adjustments.
"I don't know how they get those guys to do that there ... they just had real professional hitters to where if they have weaknesses, they come back the next year with those weaknesses fixed.
"People try to do that all the time, but it is not that easy. He's one of those guys that if you are getting him out one way, he'll find a way to not let that happen very long."
Corbin, 6-2 with a 2.87 ERA, is second in the NL with an 0.94 WHIP and is third with 105 strikeouts. He beat the Pirates at Chase Field last season, giving up four runs in six innings of an 11-4 victory. That was his only victory in four career starts against the Pirates after losing twice to them in 2016.
Corbin is 4-2 with a 2.93 ERA in six starts at home this season.
Musgrove, acquired with Colin Moran and two others in the offseason trade that sent Gerrit Cole to Houston, will be making his fourth start for the Pirates after opening the season on the disabled list with a right shoulder strain.
Musgrove won his first two starts, giving up one run in 14 innings, before suffering a 5-0 loss to the Los Angeles Dodgers last Tuesday in which he gave up three earned runs in five innings.
He made one relief appearance against the Diamondbacks while with Houston, giving up one hit in 1 1/3 innings.