SAN FRANCISCO (AP) -- Pittsburgh's Gerrit Cole struck out a season-best nine batters to steer the Pirates to a 4-3 win at San Francisco on Monday, giving the visitors a small measure of revenge for their critical loss to the Giants last year.
The defeat dropped the Giants off the pace in the National League West division, while in the NL East, the New York Mets reclaimed a share of the lead by convincingly defeating San Diego.
In the American League, Houston continued its late-inning magic to beat Baltimore and the Los Angeles Angels won their fifth straight game by downing Tampa Bay.
The Pirates met the Giants for the first time since last season's one-game NL wild-card playoff which San Francisco won and then went on to take out the World Series.
Pittsburgh starter Cole (8-2) struck out the side in order in the fourth, then worked a 1-2-3 fifth before loading the bases with none out in the sixth. He got out of it with a strikeout and then inducing an inning-ending double play.
Pittsburgh's Neil Walker hit a tiebreaking two-run double in the fifth after a pair of called strikeouts.
New York Mets pitcher Jacob deGrom did not allow a runner on base until the sixth inning, guiding the visitors to a 7-0 win at San Diego.
The lanky right-hander struck out the first four batters and after belatedly allowing a baserunner in the sixth he quickly closed out that frame by inducing a double-play.
DeGrom faced one batter over the minimum for eight innings, allowing only two hits.
Houston's Evan Gattis drove in two runs in a four-run seventh inning which lifted the Astros to a 5-2 victory over Baltimore.
The Astros have scored a major league-leading 94 runs in the seventh inning or later this season.
They trailed by one run entering the seventh before a leadoff single by Chris Carter prompted a change of pitcher, but Brad Brach issued a walk then a single to load the bases.
George Springer singled with one out to tie the game and Jose Altuve's sacrifice fly put Houston on top before Gattis drove in two more to make it 5-2.
Los Angeles' Albert Pujols homered twice to power the Angels to a 7-3 win against Tampa Bay.
Pujols extended the Angels' lead to 5-3 in the fifth inning with a solo shot, then hit a two-run homer in the eighth to end the scoring. It was his 13th this season and 533rd of his career, one shy of Jimmie Foxx for 17th place all-time.
The three-time NL MVP, who has homered in four of his past five games, has 1,117 extra-base hits for his career -- tying Foxx and Ted Williams for 16th in that department.
Mike Trout and David Freese also went deep for the Angels, who have 13 homers over their past five games.
The Angels' crosstown rivals, the Los Angeles Dodgers, also won, defeating Colorado 11-4 to open a 1-1/2 game lead in the NL West.
Dodgers pitcher Clayton Kershaw had a career-high three hits to back his strong pitching performance.
Known for his powerful left arm, Kershaw (4-3) was just as lethal at the plate. He had a double and two singles, including a run-scoring liner as part of a six-run sixth inning that broke open a tight game.
At the mound, Kershaw allowed two runs over seven innings. He hasn't lost to the Rockies in nearly two years, spanning nine starts.
Joc Pederson hit one of Los Angeles' four homers.
New York's Mark Teixeira hit his ninth career grand slam off Seattle ace Felix Hernandez in the fifth inning to power the Yankees to a 7-2 win at the Mariners.
A singles from Carlos Gomez in the first inning provided the only run of the game as Milwaukee won 1-0 at St. Louis.
Atlanta's Freddie Freeman homered for the second straight game as the Braves beat Arizona 8-1.
Chicago's Jason Hammel had a career-high 11 strikeouts in 6 2-3 innings to lead the Cubs to a 5-1 win at Miami.