What is it with Jeurys Familia and the San Francisco Giants?

Familia, who lost to the Giants in last year’s wild-card game, gave up four runs in the ninth inning to blow a save and took the loss as the Mets ended their homestand with a 6-5 defeat before 31,066 Wednesday at Citi Field.

Rookie Christian Arroyo’s three-run double was the big hit for the Giants and snapped a 3-3 tie. But the seeds of trouble were sown when third baseman Wilmer Flores threw away a potential game-ending double-play ball with one out.

Flores made a bid for redemption with a two-out, two-run double in the ninth that was nearly a tying home run. The drive to left-center tipped off the glove of centerfielder Justin Ruggiano and hit the top of the wall.

“I thought I hit it well,” Flores said. “I was hoping it was going out. You want to make something happen. I got the opportunity, but it didn’t go out.”

With the potential tying run on second, Kevin Plawecki dribbled one in front of the plate and was thrown out to end the game and the Mets’ 4-2 homestand.

advertisement | advertise on newsday

The Mets were leading 3-2 and were poised to go above .500 for the first time since April 19 when Familia entered for his third appearance in three days. The second one came Tuesday night with the Mets leading 6-1. Familia threw just 10 pitches.

Terry Collins flatly rejected (the actually quite silly) notion that Familia was overworked. “I said the other day, ‘This guy’s thrown what, 17 pitches this week?’ ’’ Collins said. “He was fine.”

Familia worked three days in a row four times last season and converted a save on the third day six of seven times.

“He threw 10 pitches (Tuesday),” Collins said. “He’s the closer. He’s used to coming back back-to-back. That’s what he’s done for years. He had 51 saves last year and go look it up, how many times he pitched three days in a row. That was not the issue.”

Familia’s most infamous outing against the Giants came in last year’s playoffs, when he allowed a three-run home run to Conor Gillaspie in the ninth inning in the 3-0 loss that ended the Mets’ season.

Mets videos

This time, Bruce Bochy sent up Gillaspie to pinch hit leading off the ninth. Familia got him on a fly ball to left but walked Joe Panik. Eduardo Nunez followed with a shot to Flores, who bobbled the ball and threw wildly to second base for an error.

“I was just trying to catch it,” Flores said. “Once I knocked it down, I didn’t put myself in a good position to make a throw to second base.”

Hunter Pence grounded a single to left past the diving Flores to tie it at 3. Buster Posey walked to load the bases before Arroyo crushed a bases-clearing double to the wall in left-center to give San Francisco its first lead. Familia left the mound to boos.

“Number one, the base on balls to Panik hurt him,” Collins said. “He got a ground ball that could have gotten (him) out of the inning. After that, he just didn’t make any pitches.”

The Giants, who snapped a five-game losing streak, hadn’t won a game when trailing after eight innings in exactly two years.

advertisement | advertise on newsday

Lefthander Tommy Milone, whom the Mets claimed off waivers from Milwaukee on Monday, started and allowed two runs in five-plus innings. Milone gave up six hits, walked two and struck out five.

The Mets took a 1-0 lead in the first on Curtis Granderson’s two-out double off Matt Cain. Posey homered for the third straight game to tie the score at 1 in the second. Jay Bruce hit his 10th home run to give the Mets a 2-1 lead in the third, and Milone grounded a run-scoring single to right to make it 3-1 in the next inning. Ruggiano’s sacrifice fly in the sixth pulled the Giants to within a run. That’s how it stayed until the ninth.