LOS ANGELES — Matt Moore had pitched extremely well at Dodger Stadium, coming one out short of his first career no-hitter for San Francisco last month.

What a difference a few weeks made.

Moore struggled from the outset, giving up six runs and seven hits in a scant one inning that equaled the shortest outing of his career in a 9-3 loss to Los Angeles on Wednesday night.

The Giants have lost four of five and dropped six games behind the NL West leaders, although they remained tied in the NL wild-card race after both the Mets and Cardinals lost earlier.

“You’ve got to savor being in this position,” Giants manager Bruce Bochy said. “There are too many times I haven’t been in this position. We are in it; it’s going to be a fight here the next 10 games.”

Moore (11-12) walked one and struck out none in a messy outing for the left-hander. He had his no-hit bid on Aug. 25 in Los Angeles broken up on Corey Seager’s single in the ninth. Moore previously held the Dodgers to just one unearned run in 15 1/3 innings at their stadium.

“This is as good as I’ve ever felt going into a game,” he said. “It was a bad night to have a bad night.”

Yasiel Puig’s three-run homer highlighted a five-run first for the Dodgers, who have 10 regular-season games remaining, including three in San Francisco next week.

“The guy is dangerous,” Bochy said. “You make a mistake and he can do something with it. He’s got power. He’s a big right-handed bat.”

The Dodgers pounded out 12 hits in taking two of three from the rival Giants.

Kenta Maeda (16-9) allowed two runs — one earned — and three hits in five innings while improving to 4-0 against the Giants this season. The right-hander struck out six and walked one in making his 30th start of the season for just the second time in his career. Maeda is one win from tying Rick Sutcliffe’s record by a rookie set in 1979.

After winning Monday’s opener 2-1 in the ninth inning, the Dodgers lost Tuesday’s game 2-0.

This one wasn’t close after the first.

The Dodgers took a 5-1 lead in the bottom of that inning on Puig’s 11th homer and RBI singles by Adrian Gonzalez and Maeda.

They made it 6-2 in the second on Justin Turner’s sacrifice fly. Howie Kendrick doubled in two more runs with two outs in the third. The Dodgers added another run on pinch-hitter Andrew Toles’ RBI double in the sixth.

The Giants’ runs came on Angel Pagan’s RBI single in the first, Ehire Adrianza’s homer in the second and Brandon Belt’s RBI single in the sixth.

TRAINER’S ROOM

Giants: RHP Johnny Cueto had an MRI on Wednesday that confirmed a Grade 1 groin strain, which forced him out of his start in the sixth inning Tuesday. He’s questionable for his next start and manager Bruce Bochy said Cueto could be out up to a week. The team hasn’t finalized a contingency plan. … SS Brandon Crawford came out of Tuesday’s victory with a dislocated left pinky on his glove hand in the second. He’ll return as soon as he feels able, Bochy said.

Dodgers: LHP Scott Kazmir comes off the disabled list to start Friday against Colorado after missing nearly a month with neck inflammation. He’s expected to throw about 90 pitches, but will be monitored. He threw a 35-pitch bullpen session on Tuesday.

VISITING VIN

Bochy visited retiring Dodgers broadcaster Vin Scully before the game, joining a long list of opposing managers and players who’ve done so this season. They chatted in Scully’s fifth-floor booth, where Bochy said he could “see where he does his magic.”

“I was telling him all the memories that go through my head,” the manager said. “I’ve been coming to the ballpark for 21 years; he’s been here 67 years. He’s an incredible man who has done so much for the game.”

UP NEXT

Giants: RHP Jeff Samardzija (11-10, 3.97 ERA) starts the series opener against the Padres. He’s 3-1 with a 4.31 ERA in five starts against them this season. He’s struggled in his last two outings, allowing nine runs (eight earned) in 11.0 innings.

Dodgers: LHP Brett Anderson (0-2, 24.75) starts the series opener against the Rockies for the first time since Aug. 20 after being on the disabled list with a blister on his left index finger. He’s made just two other starts this season after going 10-9 in 31 starts last season.