Rivas, who was recalled Friday from Triple-A Iowa, capped Chicago's eight-run second with a three-run homer. He tacked on RBI singles in the fourth and fifth.
Rivas is 5 for 11 over his two stints with the Cubs this year.
''He's pretty in tune to what's going on,'' manager David Ross said.
The Cubs finished with 23 hits in their most lopsided shutout win dating to at least 1901. Their 21 runs were their most since scoring 26 at Colorado on Aug. 18, 1995, and their 21-run margin was their largest since beating the Boston Braves 24-2 on July 3, 1945.
Nico Hoerner collected a career-high four hits, and Seiya Suzuki, Willson Contreras and Ian Happ had three hits apiece.
Each player that batted for the Cubs (7-8) collected at least one hit and scored at least one run.
It was more than enough support for Kyle Hendricks (1-1), who pitched seven innings of two-hit ball. Sean Newcomb worked the eighth in his Cubs debut and Scott Effross finished the three-hitter.
''It was easy to pitch to contact,'' Hendricks said.
The Pirates (7-8) have lost four of their last six games. It was the largest loss in Pirates history, and the 21 runs equaled the most they have allowed since May 25, 1954, at the New York Giants.
Zach Thompson (0-2) was tagged for nine runs - four earned - and nine hits in two innings.
Thompson allowed four consecutive hits with one out in the second before shortstop Kevin Newman committed errors on consecutive plays. Newman has been charged with four errors in 12 games after making three in 132 games in 2021.
''I'll try to flush it,'' Newman said.
The Pirates' bullpen, which held the Cubs scoreless for 10 1/3 innings in the first two games of the four-game set, allowed 12 earned runs over the final six innings. Infielder/outfielder Diego Castillo pitched the eighth and allowed four runs.
Eighteen of the Cubs' hits were singles. Suzuki, Contreras and Happ hit consecutive doubles to start a five-run fifth.
''I like 21 any way we can get it,'' Ross said.
The Pirates and Cubs are the only major league teams to each have a 20-run shutout against the other, according to STATS. The Pirates beat the Cubs 22-0 on Sept. 16, 1975.
Pirates: 2B Josh VanMeter was scratched because of an illness.
Cubs: OF Clint Frazier (appendicitis) underwent successful surgery. ''I got a pretty funny text back saying he's ready to rake,'' Ross said. ''He seems to be doing well.''
Pirates RHP J.T. Brubaker (0-1, 9.82 ERA) pitches in the series finale Sunday. Brubaker allowed four runs in five innings Tuesday in a 5-2 loss to the Brewers.
Cubs LHP Justin Steele (1-1, 4.30 ERA) takes the mound. Steele was tagged for four runs in 2 2/3 innings Tuesday in a 6-5 loss to the Rays.
More AP MLB: https://apnews.com/hub/mlb and https://twitter.com/AP-Sports
Copyright 2022 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.