SANTA CLARA, Calif. — The final play of the game, in two of the Vikings' first five losses this season, was a field goal by the opposing team in overtime. In the other three games, Greg Joseph missed a field goal on the final play in Arizona, and Kirk Cousins twice threw incomplete on the final play when Minnesota needed a touchdown.

On Sunday, as Jimmy Garoppolo kneeled twice to drain the final 45 seconds off the clock, the Vikings watched an opposing quarterback perform the perfunctory ritual to close out a sure victory for the first time this season. It came at the end of a 34-26 Vikings loss to the 49ers that, in one sense, was easier to explain than many of their previous five.

The Vikings went 3-for-11 on third and fourth downs. They turned the ball over twice inside their own 10-yard line, staking the 49ers to 10 points. They allowed 208 rushing yards in a building where they've never given up fewer than 186, and their defense, thinned further by injuries on Sunday, spent 37:07 on the field.

Yet in the bowels of Levi's Stadium, the Vikings lamented a game they still had opportunities to win. Cousins lamented the ball he'd thrown too low for Justin Jefferson on a two-point conversion after Kene Nwangwu's kickoff return touchdown, and the one he fired too high for Jefferson on a fourth-and-goal from the 49ers' 3 that could have put them in position to tie the score. Eric Kendricks praised the team's resiliency in twice scoring after San Francisco took double-digit second-half leads. And Mike Zimmer seethed about the officiating, on everything from holding penalties that weren't called on Deebo Samuel's first touchdown to a call officials didn't make against K'Waun Williams for contact with K.J. Osborn at the end of the game.

The loss dropped the Vikings to 5-6, but might not damage their playoff hopes that much in the diluted NFC. They remain in possession of the conference's seventh and final playoff spot, with a game against the winless Lions next week as an opportunity to get right.

But as they left a building where they've yet to win, worried about the health of several key starters and fuming about another missed chance to go above .500 for the first time since their playoff loss to the 49ers two years ago, the defeat certainly stung.

"If we had been able to find a way to win, I'd be saying how proud I am of how our roster fought and [how] many guys contributed," Cousins said. "But [we] came up short. Very disappointing. This one hurts right now."

Tied 14-14 at halftime, the Vikings fell behind by two touchdowns early in the third quarter, then spent the rest of the day trying to come back as key starters left with injuries.

They lost Anthony Barr to a right hamstring injury on a 30-yard completion to Brandon Aiyuk in the third quarter, and after Kevin Givens forced a Dalvin Cook fumble at the Vikings' 15 near the end of the third quarter, the running back had to be carted off the field with what a source confirmed was a dislocated shoulder. Cook will have a MRI on Monday to determine the extent of the damage.

"You just hate to see him go down and get carted off and be in the pain he was in," Cousins said. "It's tough to see from a teammate like Dalvin, who is such a key piece of our team and offense."

Early on, the Vikings continued the aggressive approach that had led them to back-to-back upsets of the Chargers and Packers.

After Harrison Smith picked off an overthrown Garoppolo pass while lurking in the middle of the field, offensive coordinator Klint Kubiak called a flea-flicker on the Vikings' second series that went for 29 yards to Adam Thielen, who motioned across the Vikings' formation and drifted downfield unnoticed. The Vikings opted to go for it on fourth-and-goal from the 49ers' 2, and Cousins hit Thielen for the opening score in the back of the end zone.

Cousins hit Jefferson for gains of 30 and 15 in the second quarter, then found Thielen for a second touchdown. The 49ers defense had converged on Jefferson's shallow crossing route and Thielen adjusted to a back-shoulder throw from Cousins to beat 49ers safety Talanoa Hufanga, who was out of position on the play.

But the 49ers' put together two touchdown drives of their own, scoring for the first time on a 20-yard Samuel run that started Zimmer's day of appealing to the officials.

BOXSCORE: San Francisco 34, Vikings 26

After Samuel's score, Zimmer walked onto the field, showing his tablet to down judge Kent Payne. The Vikings wanted George Kittle called for holding Kendricks on the play; Kendricks threw up his arms as Samuel scooted past him around the right side of the line.

"I mean, these guys hold all the time," Zimmer said. "So they're grabbing us around the waist, grabbing our backs. The officials, they don't want to call it on every play, but until they start calling it on every play, they're not gonna stop doing it."

Kittle said afterward that Kendricks exaggerated on the play, adding the Vikings hadn't gotten holding penalties he believed they should have drawn. "It's football," he said. "Refs throw flags, refs don't throw flags. It's just the game. If you're going to sit on the sideline and complain about holding the whole time, I'd tell your guys to make better plays."

The 49ers scored again before halftime to tie the score, running the Vikings' total of points allowed in the final two minutes of the first half this season to 66. That's the most by any NFL team in its first 11 games since at least the year 2000, according to the Associated Press.

And after Samuel evaded Nick Vigil's tackle attempt for a 49-yard run on the opening drive of the third quarter, the 49ers needed just over two minutes of game time to break things open.

Samuel scored on a 3-yard run, and on the Vikings' next offensive play, Cousins locked onto Thielen on a hook route. He never saw 49ers linebacker Azeez Al-Shaair dropping into a zone, and Al-Shaair picked off the pass, returning it to the Vikings' 2. Elijah Mitchell's touchdown on the next play made it 28-14.

"Just a poor throw, poor read. You know, made a poor decision," Cousins said. "Just got blocked out and shouldn't have thrown it where I did."

The Vikings would pull within eight on their ensuing touchdown drive before Greg Joseph pushed an extra point wide right, and they got within five after Nwangwu became the first NFL player with two kick return TDs in a season since Cordarrelle Patterson in 2015.

But on the fourth-quarter drive where Cousins missed Jefferson in the end zone on fourth down, the Vikings needed to burn two timeouts: one on a challenge that failed to produce conclusive evidence Thielen made a fingertip catch, and another when Cousins mistakenly lined up underneath guard Oli Udoh, not center Mason Cole.

"I was just moving, trying to get everybody settled up and just got under the wrong guy," Cousins said.

It was among the stranger developments of a loss that was less straightforward than it seemed.

"I think we have to have faith that things will start going our way," Kendricks said. "We're absolutely right there. You know what I mean? Absolutely. Don't count us out."