Despite winning its nonconference finale, Stanford might have suffered an important loss Saturday night.

Point guard Daejon Davis injured his left ankle in the late stages of the Cardinal’s 93-86 win over Long Beach State at Maples Pavilion.

Stung by not starting, Stanford senior center Josh Sharma had three big baskets down the stretch on his way to career highs of 23 points and 18 rebounds.

Head coach Jerod Haase “challenged me to play with more passion, more intensity, so that’s what I tried to do coming off the bench,” Sharma said.

Davis, who had 17 points and five assists, injured his left leg and went to the locker room with 6:40 left and the Cardinal leading 70-64.

“Obviously, Daejon’s a huge part of this team,” Sharma said, “but we’ve got a lot of guys who are willing to step into his role, especially in a close game like that one.”

The Cardinal regrouped without him and hung on for the win, but it wasn’t without controversy.

49ers head coach Dan Monson was ejected in the final seconds. He came onto the court to protest a non-foul call after a missed three by Jordan Griffin that could have tied the score with seven seconds left.

“I just thought they never protected our shooters all game, and I felt like he got hit on the arm,” Monson said. “I think they call that in the meat of the game but they didn’t (at the end). I was just trying to protect my players.

“I don’t think the referees lost us the game. Our rebounding lost us the game. But that last non-call cost us an opportunity to keep playing, that’s all.”

The 49ers were down to 86-84 after a three by Griffin with 56 seconds left. Stanford’s KZ Okpala and Long Beach State’s Temidayo Yussuf traded layups. Isaac White’s free throw made it 89-86, and Griffin missed the final three.

Okpala finished with 20 points for Stanford (7-5), which is 5-0 at home.

“I like the guys’ mind-set,” Haase said. “I like how they take the messages and apply them. Our execution is not where it needs to be. It’s on my shoulders. I have to get them to understand the value of not turning the ball over.”

Haase said he didn’t know the severity of Davis’ injury or how long he would be sidelined. As for Sharma, Haase said he didn’t start “because I was mad at him. He needs to play more consistently, play harder, be more of a leader as a senior.”

Bryan Alberts had 22 points and Deishuan Booker had 20 for Long Beach State (5-10). Yussuf added 13.

It was a rough night for the Pac-12, headlined by UCLA’s 15-point loss at home to Liberty and Arizona State’s loss to Princeton, a week after beating former No. 1 Kansas. Conference teams went 3-5 on Saturday.

Tom FitzGerald is a San Francisco Chronicle staff writer. Email: tfitzgerald@sfchronicle.com Twitter: @tomgfitzgerald