SAN FRANCISCO — Walker Lockett’s performances for the Mets continue to gradually improve.

The right-hander was stomped by the Cubs in his Mets debut last month, but followed that with a start against the Phillies that kept his team in the game. And Saturday he was good enough for his first major league win.

Over five innings, Lockett allowed one run on five hits with three strikeouts in helping the Mets beat the Giants, 11-4. Lockett was removed in the sixth for pinch-hitter Pete Alonso, who delivered a three-run homer that broke the game open.

“Today I attacked and was able to get quick outs,” said Lockett, who threw just 58 pitches. “I got through the fifth and gave our team a chance to win.”

Send us your MLB questions when you sign up for our Starting Lineup newsletter and our experts will answer their favorites leading up to the July 31 trade deadline.

Lockett’s teammates celebrated his first big league win by putting him in a laundry cart that was pushed into the shower, where he was covered with beer, shaving cream, mayonnaise, ketchup and baby powder.

“It’s like a rite of passage, almost — it’s real fun,” Alonso said. “Getting your first ‘W’ as a pitcher, that is huge. He threw the ball real well today, so it was awesome, well-deserved.”

Lockett, who replaced injured Zack Wheeler in the rotation, was strong into the fifth, when Joe Panik delivered a pinch-hit RBI single that pulled the Giants within 4-1. Lockett surrendered another hit in the inning, but following a visit from pitching coach Phil Regan, retired Buster Posey to end the inning. Kevin Pillar was plunked by a pitch to start the rally.

As the Mets evaluate their starting rotation options for next season, they will monitor the 25-year-old Lockett, who arrived last winter in the trade that sent Kevin Plawecki to the Indians.

Manager Mickey Callaway sees a potential fit in Lockett.

“I think he can be a long-term option at the back end,” Callaway said. “He throws strikes, he’s a competitor and he’s very comfortable out there. You don’t see a lot of nerves. You don’t see the typical, ‘Oh, I’m trying to stay in the big leagues’ type mentality. You see a guy that has confidence in his stuff and plus-weapons to get guys out with.”