Five straight wins equals .500.

That was the happy equation for the San Diego Padres Saturday night as Yasmani Grandal capped a five-run, fourth inning with a tape-measure, three-run homer and Jason Marquis rallied from a slow start to win his eighth straight decision as the Padres defeated Arizona 6-4 before 29,756 at Petco Park.

The win marked the first time this season that the Padres won five straight games.

And it marked the first time this season – actually the first time in 383 games dating back to April 10, 2011 – that the Padres reached .500.

The win also pulled the Padres to within three games of the National League West Diamondbacks.

The Padres have gone 29-19 since their 5-15 start. Last season, the Padres were 24-44 after 68 games.

“It looks good on paper,” Padres manager Bud Black said of reaching .500.

“I think it sends a great message to our guys. They have fought awfully hard since early April to get back to where they are now.”

It didn’t seem like they were going to reach .500 early Saturday as the Diamondbacks built a 3-0 lead against Marquis, although the right-hander allowed only three hits over 6 2/3 innings and retired 10 of the last 11 hitters he faced.

“The first 30 pitches were not what we’re used to seeing from Jason,” said Black. “He got stronger as the game went on.”

The Padres wiped out the three-run deficit with a five-run fourth.

Key to the Padres’ five-run fourth was a fielding error by Diamondbacks rookie shortstop Didi Gregorius following a lead-off single by Everth Cabrera – a drive to right that doubled as the Padres first hit.

Chase Headley put the Padres on the board with a line-drive single to center off an 0-and-2 pitch from Arizona left-handed starter Wade Miley. Logan Forsythe, who made his first professional start as an outfielder, brought the Padres to within a run with a sacrifice fly.

A single by Jesus Guzman brought Grandal to the plate with runners at the corners and two outs.

The catcher drove a 2-and-2 pitch from Miley 442 feet into the second deck in left. It was the second-longest homer by a Padre this season – to Logan Forsythe’s 445-foot shot to left-center on Monday – and the fifth-longest ever by a Padre at Petco Park.

The homer was the first of the season for Grandal, who missed the first 50 games with a suspension for testing positive last September for a performance-enhancing drug (testosterone).