Gregory Polanco drove in four runs and Jordy Mercer had three hits and an RBI, providing plenty of support for the Pirates to take two of three in the series.
Volquez, Justin Wilson and Stolmy Pimentel combined on the three-hitter.
Miami actually had one hit going into the ninth inning. Christian Yelich legged out an infield single, and Stanton homered at PNC Park for the first time. Before the two-run blast, Pittsburgh was the only place the slugger hadn't hit a home run in while playing in at least six games.
The Marlins also weren't pleased with home-plate umpire Chad Fairchild's strike zone.
"[Volquez] mixed his speeds and threw some breaking balls for strikes," Miami manager Mike Redmond said. "He got some help back there too. He got some strike calls there, a lot of them."
But a scary incident in the bottom of the seventh marred the night even more for Miami. Reliever Dan Jennings was struck on the left side of the head by Mercer's comeback liner. There was deep concern for Jennings, who was tended to for several minutes before he was carted off the field.
The crowd cheered for Jennings, who raised his right hand as a signal that he was all right. The 27-year-old was taken to a local hospital. A CT scan was negative, and Jennings was diagnosed with a concussion. He stayed overnight while the Marlins traveled to Cincinnati.
"You're telling yourself, 'I hope he gets up.' You hope he can get up and that he's fine," Mercer said. "I just patted him on the back. There's nothing really I could do. That's what stinks about it, too."
From the Marlins' perspective, the incident overshadowed the rough results.
Catcher Jarrod Saltalamacchia rushed to the mound and helped balance the lefty, who maintained consciousness.
"You definitely think about it," Saltalamacchia said. "It's part of the game. Hopefully they can find something that works that will protect pitchers. I know they've been doing a pretty good job protecting catchers. I think it's time we need to start worrying about those guys, too."
Volquez was dominant throughout. The right-hander flirted with a no-hitter for 4 1/3 innings before Solano singled to left. By the time the Marlins got the hit, they trailed by three.
Thursday marked the fifth time the Marlins were held to three hits in a game this season. Had Miami not been able to break through in the ninth, it would have been the first time since June 15, 2012, at Tampa Bay that the club was one-hit. Solano, ironically, had the lone hit that game.
Marlins lefty Brian Flynn was touched for five runs on eight hits in four-plus innings. The Marlins turned to Flynn to make the start in place of Jarred Cosart, who was scratched due to a tight left oblique muscle.
A starter all season at Triple-A New Orleans, Flynn made one relief appearance with the Marlins this year on June 27 against the A's.
Flynn became Miami's 12th different starter this season, matching a franchise record initially set in 2002 and '13.
The lefty kept the Pirates in check through three innings, but in the fourth, a leadoff double by Mercer set in motion a three-run frame. Russell Martin delivered an RBI single, and Polanco slapped a two-run single to left.
"I made some mistakes and paid for them in that fourth inning," Flynn said. "Not staying ahead of the leadoff guy, and the double happened. It kind of went from there."
The sluggish Miami offense didn't threaten until Stanton's homer in the ninth.
"Flynn was good for the first three innings, and then they got to him after that," Redmond said. "It's one of those nights, we've got to be able to swing with these guys, and we didn't do it."