SAN FRANCISCO — Off to a historically good start, the Cubs finally appear to be slowing down.

Of course, Madison Bumgarner probably had something to do with that.

The left-hander pitched 7? dominant innings and doubled in a run in the fifth to lift the San Francisco Giants over the Cubs 1-0 on Sunday night. The loss was the Cubs fourth in six games to start a nine-game road trip.

The Giants won for the 11th time in 12 games and took two of three from a Cubs team with the best record in baseball.

Bumgarner (6-2) struck out six and allowed 3 hits and 2 walks while winning his fifth straight decision. The Giants have won the left-hander’s last 6 starts.

Entering play, the Cubs (29-13) had their best record in franchise history through 41 games since 1918.

“They played well, we played well. Their pitcher drove in the winning run,” Cubs manager Joe Maddon said. “There’s nothing to be upset about when your team plays that hard and that well. Sometimes you don’t win. We pitched great, but so did they. And they got the run and we did not.”

The Giants won despite a persistent problem hitting with runners in scoring position. They were 0-for-7 in that department and have 16 hits in their last 98 at-bats with runners in scoring position.

Bumgarner’s run-scoring double to left off Kyle Hendricks (2-4) followed Gregor Blanco’s leadoff walk.

“That was the game right there,” Hendricks said. “Facing that kind of guy, going into it, I kind knew I would have to keep it close. The thing for me was the leadoff walks. It can’t happen. That was the only bad part. Overall my stuff was moving. I just wasn’t commanding it well. I couldn’t get good command until later.”

Bumgarner became the first winning Giants pitcher to drive in the only run in a 1-0 game since Russ Ortiz on Aug. 8, 2000, against the Brewers. Hendricks allowed 1 run on 3 hits and 3 walks in 5? innings.

Giants manager Bruce Bochy summoned Cory Gearrin to face Kris Bryant after Bumgarner gave up a two-out walk to Anthony Rizzo in the top of the eighth. Bumgarner had retired 19 of the previous 20 batters.

Gearrin got Bryant to line out to shortstop Brandon Crawford on the first pitch.

Giants closer Santiago Casilla pitched a scoreless ninth for his 12th save.

Ben Zobrist was 1-for-3 against Bumgarner with a single in first inning that at the time was his sixth hit in 7 at-bats against the Giants left-hander — he’s now 6-for-9 against Bumgarner.

Right fielder Jason Heyward, injured making a diving catch in Friday’s 8-1 victory over the Giants, might not be ready to play in a three-game series against St. Louis that starts tonight. Heyward suffered a contusion on his right side (near his ribs) when he robbed Denard Span of extra bases leading off the game for the Giants.

Right-hander John Lackey (4-2) tonight faces the Cardinals at Busch Stadium for the second time this year. He struck out a season-high 11 batters in 7 shutout innings in a 5-0 Cubs victory against his former team on April 18. He’s among 17 pitchers with at least 1 victory against all 30 teams.