SAN FRANCISCO — It was déjà vu all over again.

As Dominic Smith converged with Amed Rosario on Pablo Sandoval’s pop-up in the 10th inning Friday night, the Mets left fielder’s thoughts turned to his collision last season with the shortstop that had cost their team a game, against the Giants.

This time there would be no collision. Smith took his eye off the ball in order to gauge Rosario’s whereabouts and dropped it. The Giants’ Alex Dickerson was full steam ahead to home plate with the winning run in a 1-0 loss for the Mets at Oracle Park.

“The ball went up and I had a good read on it, a good beat,” Smith said following the Mets’ second straight extra-inning loss. “In a second, I got a little scared because last year we collided. I just took my eye off the ball because of what happened and ended up dropping it.”

Said Rosario: “I got a good jump on it and started to go back, and once Dom called me off, I backed off.”

Jacob Rhame — back from a one-game suspension he served Thursday for throwing behind the Phillies’ Rhys Hoskins in April — was hit with the loss after walking Dickerson to begin the inning. Unavailable were Seth Lugo, Jeurys Familia, Robert Gsellman and Justin Wilson because of recent usage. Rhame had escaped trouble in the ninth by striking out Joe Panik after walking two batters in the inning.

Wasted was a dominant performance by Jacob deGrom, who resembled the unfortunate ace who pitched to a 1.70 ERA last season but won only nine games.

A night earlier, the teams played to a 1-1 tie into the 16th inning before Pete Alonso’s solo homer put the Mets ahead. But rookie Chris Mazza didn’t retire a batter in the bottom of the inning, as Donovan Solano’s RBI single won it.

The Mets managed only three hits Friday and have scored only two runs over their last 26 innings. Tyler Beede (who entered with a 5.44 ERA) carried the load for the Giants by pitching eight scoreless innings. On Thursday, the Mets scored only one run over nine innings against Giants ace Madison Bumgarner.

“It’s hard to explain,” manager Mickey Callaway said. “Their starters and some of their relievers have had some real good outings against us, but we should be able to squeeze by more than that.”

The surging Giants remained among MLB’s hottest teams, with a 14th victory in 16 games that moved them back to .500. Meanwhile, the Mets dropped to 44-53.

“It’s a little bit frustrating because we had two games we should have won, and coming off the Twins series and the Miami series, we were feeling good about ourselves,” Smith said. “Jake pitched a great game tonight, and when he has outings like that, we have to give him support and we weren’t able to do that and it costs us the game.”

DeGrom, who pitched seven shutout innings in which he allowed three hits and walked three, struck out 10 batters for his sixth double-digit strikeout game of the season. Along the way, he moved ahead of Ron Darling into sixth place on the franchise’s all-time strikeout list. DeGrom now has 1,154 strikeouts with the Mets.

In his previous start, a tiring deGrom had lasted only five innings against the Marlins, allowing one run. He has allowed two runs or fewer in 10 of his last 11 starts.

“This was a tough one tonight,” deGrom said.

DeGrom wasn’t tested until the fifth, when Kevin Pillar stroked a two-out double. But deGrom rebounded to retire Panik, keeping the game scoreless. The Giants’ only previous hit was Brandon Belt’s single leading off the game. But after deGrom struck out the next two batters, Belt was caught stealing second.

Robinson Cano’s two-out double in the fourth gave the Mets their best chance early against Beede, but the right-hander retired Wilson Ramos to end the threat. Jeff McNeil’s single leading off the game was the Mets’ only other base runner until deGrom walked leading off the sixth and was left stranded.