Kevin Pillar hit a three-run home run in the 12th inning, lifting the New York Mets over the San Francisco Giants 6-2 on Wednesday hours after the team's owner called out its hitters for a lack of production.

With his club stuck in a five-game skid, Mets owner Steve Cohen tweeted Wednesday morning that "it’s hard to understand how professional hitters can be this unproductive. The best teams have a more disciplined approach. The slugging and OPS numbers don’t lie."

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

The barbs hardly seemed to inspire New York early on. Six Giants pitchers combined to blank the Mets until the ninth inning, when J.D. Davis provided a tying sacrifice fly.

The Mets offense finally broke through in earnest in extras. The teams traded runs in the 11th before the Mets scored four runs against Tyler Chatwood (1-3) in the 12th. Pillar — a former Giants player — broke a 2-2 tie with his 10th homer of the year, and Chance Sisco added an RBI double to make it 6-2.

Mets manager Luis Rojas addressed Cohen's statement before the game and said the players and coaches needed to be held "accountable" for their results.

"I’m aware of the tweet from Steve," Rojas said. "We’re working really hard every day. We’re trying to find our way to win some games."

Entering Wednesday, the Mets’ 450 runs were third-fewest in MLB, ahead of only Texas (446) and Pittsburgh (431).

Michael Conforto also had an RBI for the Mets. Lamonte Wade Jr. and Tommy La Stella recorded RBIs for San Francisco.

The Giants used eight relievers, who combined for 10 2/3 innings after starter Anthony DeSclafani exited with right ankle discomfort in the top of the second.

New York starter Tylor Megill pitched six innings, allowing just one run. Jeurys Familia (7-3) surrendered an unearned run in the 11th but still got the win.

CLICK HERE TO GET THE FOX NEWS APP

DEFENSIVE GEMS

The Giants made a pair of highlight-reel defensive plays to keep the game tied at 1 in the late innings. In the ninth, shortstop Brandon Crawford robbed Dominic Smith of a single up the middle by diving to his left and using his glove to flip the ball to second base, forcing out Conforto.

The next inning, with a runner on first base, Wade took an extra-base hit away from Pillar with a leaping catch against the left-field wall.

TRAINER’S ROOM

Mets: C James McCann missed his second straight game with back spasms and could go on the injured list if he doesn’t improve in the coming days. ... SS Javier Báez (back spasms) fielded grounders for the third day in a row. He is eligible to come off the IL Sunday.

Giants: DeSclafani appeared to injure the ankle while covering first base on a ground ball by Dominic Smith in the second inning. The right-hander stayed in for one more batter, walking Jonathan Villar, before leaving the game. ... 3B Kris Bryant returned to the lineup after missing Tuesday’s game due to mild tightness in his left hamstring. He went 0 for 5 with three strikeouts.

ROSTER MOVES

The Mets recalled Sisco to serve as a backup in McCann’s absence and optioned RHP Yennsy Díaz to Triple-A Syracuse.

UP NEXT

Mets: RHP Taijuan Walker (7-7, 3.75 ERA) will try to snap a four-game losing streak Thursday night as New York opens a four-game series in Los Angeles against the Dodgers. Walker’s last win came July 3 against the Yankees.

Giants: Following an off-day Thursday, LHP Alex Wood (10-3, 4.14) will open a three-game series in Oakland against the Athletics. San Francisco took two of three from Oakland in Part 1 of the Bay Bridge Series in June.