LOS ANGELES — The San Francisco Giants lost two important players Tuesday night and still managed a critical victory.

Eduardo Nunez and Brandon Belt homered to help the Giants overcome injuries to All-Star pitcher Johnny Cueto and shortstop Brandon Crawford in a 2-0 win over the Los Angeles Dodgers.

San Francisco pulled into a three-way tie with the Mets and Cardinals for the two NL wild cards. The Giants are five games behind the NL West-leading Dodgers with 11 to play.

Cueto (17-5) left in the sixth with a strained groin, but the much-maligned Giants bullpen delivered as three relievers combined to pitch shutout ball over the final 3 2/3 innings.

Crawford came out with a dislocated left pinky in the second. An X-ray was negative, and the Giants said he is day to day.

A team trainer checked on Cueto with Andrew Toles at bat. The right-hander stayed in and walked Toles, then motioned that he was done.

Cueto is scheduled to have an MRI on Wednesday.

“I felt uncomfortable,” he said through a translator. “It was bothering me, so that’s why I didn’t finish the inning.”

Crawford was injured sliding into third base when he was thrown out trying to advance from first. He said a trainer popped his finger back into place after he came out of the game. He was wearing a splint afterward.

“At first I was hoping it was just jammed,” Crawford said. “I went down to kind of feel it when I was on the bag and felt that it was out of place.”

It was Vin Scully bobblehead night at Dodger Stadium. A sellout crowd gave the longtime broadcaster a loud standing ovation before the game, and Scully responded in kind.

The bobblehead featured Scully with his hands over his heart thanking fans, depicting a warm moment from opening day this year. Scully is retiring after this season, his 67th in the booth. His final game will be Oct. 2 when the Dodgers play at San Francisco in their regular-season finale.

The attendance of 53,621 was the largest regular-season crowd in Major League Baseball since Aug. 30, 2012, when the Dodgers had another Scully bobblehead giveaway.

Rich Hill (12-5) started for the Dodgers and pitched five innings, allowing just one run — the homer by Nunez — and six hits while striking out seven and walking one. Hill came out after 77 pitches.

Los Angeles manager Dave Roberts took Hill out as a precaution due to concerns about a recurring blister.

“It was more of preservation, where he was at, and to put him in a situation to go any deeper,” Roberts said. “It’s the blister that we’re consciously trying to monitor. I think where we’re at, it’s a very important game, but I just didn’t know how much longer he was going to go. It was going to be another inning at the most anyway. I felt that was good for him.”

Hill’s debut with the Dodgers was delayed almost a month because of blister issues. This was his fifth start with the team.

“I threw the ball well, but at the end of the day it was disappointing,” Hill said. “One mistake to Nunez, a fastball that was supposed to be down. Completely missed all the way in. He did his job and what he should’ve done with the pitch. I take 100 percent responsibility for this. It’s not acceptable to miss like that at this level.”

Following a bench-clearing scuffle involving Madison Bumgarner and Yasiel Puig on Monday night, Puig, Adrian Gonzalez and other Dodgers posted pictures on social media of themselves wearing T-shirts with the hashtag “#Dontlookatme” with hands covering their eyes.

Roberts was fine with his team having fun with the heated situation Monday.

“Technology. People are quick these days,” he said. “I heard about it. I do (like that they had fun). You get two guys competing. They know what’s at stake. Emotions get in the way sometimes. I don’t think there’s anything else to it.”

The Giants have 29 blown saves, but the bullpen did its job this time following Cueto’s early departure. Sergio Romo earned his first save of the season with a hitless ninth.

“It was just one of those times where it was a really big win for us,” Romo said. “We really needed that.”

The Dodgers were 0 for 10 with runners in scoring position.

DOUBLE TROUBLE

Corey Seager doubled in the third, becoming the first Dodgers rookie to have 40 doubles in one season. He was 3 for 4.

TRAINER’S ROOM

Dodgers: LHP Alex Wood (elbow surgery) came off the 60-day disabled list and RHP Bud Norris was designated for assignment. The Dodgers plan to use Wood out of the bullpen, coming in to start innings. … LHP Brett Anderson (blister) will return to the rotation and start on Thursday. … RHP Brandon McCarthy (right hip stiffness) threw a simulated game of five innings and 75 pitches.

UP NEXT

Giants: LHP Matt Moore nearly threw a no-hitter the last time he was on the mound at Dodger Stadium. He went 8 2/3 innings before Seager ruined the no-hit bid with a blooper to right field. Moore went just five innings against St. Louis in earning the win in his last start.

Dodgers: RHP Kenta Maeda (15-9, 3.24 ERA) has given up only four earned runs and struck out 17 over his last three games covering 17 1/3 innings. He has made two starts against the Giants this season and gone 2-0 with a 3.00 ERA.