CHICAGO — Joe Panik felt a little better the past couple days in St. Louis. He felt a lot better after his performance Monday night.

Panik hit his first career leadoff homer and doubled twice, leading the San Francisco Giants to a 6-4 victory against the Chicago Cubs.

Brandon Belt also connected and Ty Blach (2-2) pitched into the eighth inning in the first meeting between the teams since San Francisco was eliminated by Chicago in the NL Division Series last year. Panik, Belt and Justin Ruggiano each had two RBIs as the streaking Giants won for the eighth time in 10 games.

"Our guys did a nice job swinging the bat," manager Bruce Bochy said.

Panik hit just .172 (10 for 58) in his previous 14 games. But he said he had some constructive conversations with hitting coach Hensley Meulens and assistant hitting coach Steve Decker during the previous series against the Cardinals that helped him find his stroke at the plate.

"Just little things. It's nothing major," Panik said. "Just going back to staying on the ball, really. Just using the whole field."

Ruggiano's leadoff drive in the eighth made it 6-0 and gave San Francisco 18 straight solo homers, just three away from matching its major league record of 21 from 2011.

The Cubs responded with four in the bottom half on two-run homers by Javier Baez and Ben Zobrist. But the rally stalled from there.

With one out and runners on first and second, Hunter Strickland got Willson Contreras to bounce into an inning-ending double play. Mark Melancon then worked the ninth for his ninth save in 11 chances.

Baez finished with three hits for Chicago, which was coming off a 13-6 victory against Milwaukee on Sunday. He singled with two out in the ninth before rookie Ian Happ struck out swinging to end the game.

"I have nothing to complain about," Cubs manager Joe Maddon said. "I shall sleep well. That's the game we're looking for right there."

John Lackey (4-4) pitched five shaky innings in his first loss in a month, allowing five runs and seven hits. The right-hander was 3-0 with a 3.86 ERA over his previous four starts.

"Honestly, I threw the ball better tonight than the last three," he said. "I felt like I executed quite a few pitches, but they got a few more balls up than we did."

Lackey looked off right from the start, with Panik driving his sixth pitch into the bleachers in left-centre for his second homer of the year. The Giants followed with two more hard-hit balls, but Lackey got bailed out by two outstanding defensive plays.

First, shortstop Addison Russell robbed Christian Arroyo of a hit with a diving stop and a strong throw to first. Then Albert Almora Jr. reached over his head for a terrific leaping catch on Belt's drive to centre.

But the Giants opened a 5-0 lead by scoring in each of Lackey's last three innings. Panik hit an RBI double and scored on Belt's single in the third. Ruggiano added an RBI double in the fourth, and Belt hit a drive to left in the fifth for his ninth homer.

BLACH'S DAY

Blach was pulled after the first three batters reached in the eighth. He was charged with three runs and eight hits.

The left-hander, who entered the rotation after ace Madison Bumgarner got hurt, is 2-0 with a 2.57 ERA in his last three starts.

"That's a tough night to pitch. That ball was flying out," Bochy said, "and he just did a super job."

TRAINER'S ROOM

Giants: CF Denard Span was sidelined by a sprained left thumb. He got jammed on a pitch during Sunday's 8-3 loss at St. Louis. "He's probably going to need a couple of days," Bochy said. ... OF Hunter Pence, who is on the 10-day disabled list with a left hamstring strain, is doing some baseball activities, like running and hitting. "He's on his way, but to put him out there in a game situation with game speed . he's a week away," Bochy said.

Cubs: LHP Brett Anderson, who is on the 10-day DL with a lower back strain, is scheduled for a bullpen session on Tuesday. "Tomorrow will be a big step," Anderson said.

UP NEXT

Giants right-hander Johnny Cueto (4-3, 4.50 ERA) and Cubs left-hander Jon Lester (2-2, 3.57) start Tuesday night in a rematch of Game 1 of last year's NL Division Series. Cueto and Lester each pitched eight sparkling innings in that one, with the Cubs winning 1-0 on Javier's Baez's eighth-inning homer.

___

More AP baseball: https://www.apnews.com/tag/MLBbaseball

___

Jay Cohen can be reached at http://www.twitter.com/jcohenap