Belt had an RBI single in the third and hit a two-run, opposite-field home run off Ryan Yarbrough (1-1) as part of a four-run fifth.
Ji-Man Choi had two hits and two RBIs for Tampa Bay. Tommy Pham walked in the first inning to extend his on-base streak to 41 games, an ongoing franchise record dating to last season.
The Rays entered the day 6-2, their best start in club history, but couldn’t hold an early lead.
The game drew 31,828, the smallest at Oracle Park since Sept. 1, 2010. The Giants set an NL record with 530 consecutive sellouts at their waterfront ballpark from 2010-17.
The fans who did show up witnessed the Giants set a season high for scoring after being limited to five runs in the previous 18 innings.
Belt and Duggar combined to drive in all six runs for San Francisco, but the Giants also got a lift from the bottom third of the order. Kevin Pillar, the No. 7 hitter, singled and scored in the third, Panik walked twice and scored both times, and Connor Joe had a pinch-hit single as part of the four-run fifth.
Yarbrough allowed four runs in three innings.
Tampa Bay used reliever Ryne Stanek as the opener. Stanek, who also started Monday against Colorado, retired all six batters he faced.
Rays: Manager Kevin Cash had hoped to give slumping SS Willy Adames the day off. Instead, Adames singled and scored as a pinch-hitter in the fifth and singled in the ninth. Adames entered the day 1 for 27.
LHP Drew Pomeranz (0-0, 3.60) pitches for San Francisco in the series finale Sunday at Oracle Park. Pomeranz went winless in two games last season. Cash has yet to announce who will pitch for Tampa Bay.