Pinch-hitter Alex Dickerson hit a go-ahead homer in the seventh, Austin Slater also connected, and the San Francisco Giants beat the Colorado Rockies 5-2 on Tuesday night to stay right in the playoff race.

Dickerson hit his first pinch-hit homer since exactly four years earlier on Sept. 22, 2016, with San Diego against the Giants at Petco Park. It was his 10th homer that season, and his 10th this year.

More Images
San Francisco Giants' Drew Smyly, rear, pitches against Colorado Rockies' Raimel Tapia during the first inning of a baseball game in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

Pinch-hitter Alex Dickerson hit a go-ahead homer in the seventh, Austin Slater also connected, and the San Francisco Giants beat the Colorado Rockies 5-2 on Tuesday night to stay right in the playoff race.

Colorado Rockies' Kyle Freeland (21) pitches against the San Francisco Giants during the first inning of a baseball game in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

Kevin Pillar hit a tying double for Colorado in the seventh against his former club. The Rockies had won two straight following a four-game losing streak.

Colorado Rockies shortstop Trevor Story throws out San Francisco Giants' Wilmer Flores during the first inning of a baseball game in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

Charlie Blackmon’s groundout got Colorado on the board in the sixth and chased Drew Smyly.

Cutouts are seated at Oracle Park as San Francisco Giants' Drew Smyly, center, pitches against Colorado Rockies' Garrett Hampson during the second inning of a baseball game in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

San Francisco players and staff will move into a hotel Wednesday as the Giants shift to a quarantined setting for the rest of the regular season.

San Francisco Giants' Austin Slater, right, kneels during the national anthem before a baseball game between the Giants and the Colorado Rockies in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

Rockies: RHP reliever Carlos Estévez continues to receive treatment since being hit on the pitching hand by an Aug. 16 line drive from Texas' Scott Heineman. In 13 outings since, Estévez has three holds, a blown save, two blown leads and a loss. Manager Bud Black said the pitcher was sore but: “He indicates to us it has no effect on his performance. I don't think he's rattled by that ... we've asked him, ‘Has that had any impact?’ He goes, ‘No, I just haven’t made very many good pitches, I'm not pitching well.' He hasn't used that as a reason for the recent struggles.”

San Francisco is one of four teams chasing the final two NL playoff spots. Philadelphia (27-29) lost its fourth straight game after a doubleheader sweep by Washington to fall behind Cincinnati (28-28), Milwaukee (27-27) and the Giants (27-27).

San Francisco Giants' Drew Smyly, rear, pitches against Colorado Rockies' Raimel Tapia during the first inning of a baseball game in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

San Francisco Giants' Drew Smyly, rear, pitches against Colorado Rockies' Raimel Tapia during the first inning of a baseball game in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

Kevin Pillar hit a tying double for Colorado in the seventh against his former club. The Rockies had won two straight following a four-game losing streak.

Tyler Rogers (3-3) recorded the final out of the seventh for the win. Sam Coonrod worked the ninth for his third save.

Slater hit his first career career leadoff homer to stake San Francisco to a quick lead, and Joey Bart added an RBI double. Brandon Belt drove in two more runs with a pinch-hit double in the seventh against Jairo Díaz (1-2), who also surrendered Dickerson’s drive.

Colorado Rockies' Kyle Freeland (21) pitches against the San Francisco Giants during the first inning of a baseball game in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

Colorado Rockies' Kyle Freeland (21) pitches against the San Francisco Giants during the first inning of a baseball game in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

Charlie Blackmon’s groundout got Colorado on the board in the sixth and chased Drew Smyly.

Rockies starter Kyle Freeland remained winless in 10 starts since Aug. 1 following consecutive victories to begin the season.

HOTEL STAY

Colorado Rockies shortstop Trevor Story throws out San Francisco Giants' Wilmer Flores during the first inning of a baseball game in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

Colorado Rockies shortstop Trevor Story throws out San Francisco Giants' Wilmer Flores during the first inning of a baseball game in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

San Francisco players and staff will move into a hotel Wednesday as the Giants shift to a quarantined setting for the rest of the regular season.

Manager Gabe Kapler didn't provide specific details on who all would be there but that it is one location that will include housing of some players from the Sacramento alternate site, such as taxi-squad players who could be needed down the stretch.

TRAINER’S ROOM

Cutouts are seated at Oracle Park as San Francisco Giants' Drew Smyly, center, pitches against Colorado Rockies' Garrett Hampson during the second inning of a baseball game in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

Cutouts are seated at Oracle Park as San Francisco Giants' Drew Smyly, center, pitches against Colorado Rockies' Garrett Hampson during the second inning of a baseball game in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

Rockies: RHP reliever Carlos Estévez continues to receive treatment since being hit on the pitching hand by an Aug. 16 line drive from Texas' Scott Heineman. In 13 outings since, Estévez has three holds, a blown save, two blown leads and a loss. Manager Bud Black said the pitcher was sore but: “He indicates to us it has no effect on his performance. I don't think he's rattled by that ... we've asked him, ‘Has that had any impact?’ He goes, ‘No, I just haven’t made very many good pitches, I'm not pitching well.' He hasn't used that as a reason for the recent struggles.”

Giants: RF Luis Basabe got hurt running to first base in the third and exited the game. ... Rookie C Chadwick Tromp went on the injured list because of a strain in his right shoulder after he jammed it during Sunday’s loss to the A's. He had an MRI exam Tuesday. Tromp's status for a potential playoff berth is still unclear. “I would not put anything off the table at this point,” Kapler said. ... OF Mike Yastrzemski did some assisted light running on the treadmill Monday among his hitting work in the cage. “Moving around much better. I'm optimistic about it,” Kapler said of a regular-season return for Yastrzemski, who missed his fifth straight game with a mild right calf strain. ... RHP Jeff Samardzija (shoulder) came out of his three-inning outing Monday at the Sacramento alternate site with no issues.

ROSTER MOVE

San Francisco Giants' Austin Slater, right, kneels during the national anthem before a baseball game between the Giants and the Colorado Rockies in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

San Francisco Giants' Austin Slater, right, kneels during the national anthem before a baseball game between the Giants and the Colorado Rockies in San Francisco, Tuesday, Sept. 22, 2020. (AP PhotoJeff Chiu)

The Giants recalled catcher Tyler Heineman from Sacramento to take Tromp's roster spot.

UP NEXT

Right-hander Ryan Castellani (1-3, 5.59 ERA) pitches Wednesday night for the Rockies looking to end a five-start winless stretch during which he is 0-2 since beating Arizona on Aug. 24.

The Giants hadn't announced a starter for Wednesday.

More AP MLB: https://apnews.com/MLB and https://twitter.com/AP_Sports