San Domenico was hoping for an all-Marin showdown for the North Coast Section Division III crown. Sixth-seeded Berkeley was hoping to play spoiler, and almost did Tuesday night against the No. 2 Panthers.

But guard Omar Williams created some magic in the closing minutes of the Panthers’ semifinal with a pair of shots from beyond the 3-point arc for a 50-47 victory over the Yellowjackets.

San Domenico (23-7) will take on top-seeded Branson (20-10) in a neighborhood matchup for the NCS championship at 7 p.m. on Friday at College of Marin.

“We’ve got to watch some film and figure out how to attack (Branson),” San Domenico head coach Tyler Gaffaney said. “They’re a great team and a great program. I know first hand because I went there and I know they have a great legacy of basketball success. It’s a great opportunity to show that we can hang with the best teams.”

Williams finished with nine points on three 3-pointers during a relatively quiet shooting night, but rediscovered his touch in time to clinch the win for the Panthers.

“I started out pretty cold, but my coach kept telling me to keep shooting, that my shots would come,” Williams said. “The coach’s confidence in me helped me keep going. I’m glad we were able to win. From a personal standpoint, this game means a lot, but now we have another game to play.”

The Panthers will be looking for their first NCS boys basketball pennant, after being ousted in the semifinals each of the past two season in the Division V bracket.

“I’m looking forward to the championship,” Williams said. “I’m not used to this situation, so I’m really excited.”

Senior Gavin Early led the Panthers with 15 points, 15 rebounds three steals and five assists, while Kris Jakstas had 13 points.

The Panthers struggled to hang with the hot-shooting Yellowjackets in the early going on Tuesday, as San Domenico fell behind 17-5 after a 3-pointer by Berkeley junior Kavi Jivan to close the first quarter.

“It was one of those games where we had to switch it up defensively, but the shift we made changed the personality of the game,” Gaffaney said. “That was a huge shift for us. Credit to Berkeley, they’re a very good team, and it’s tough to beat a good team like that.”

Berkeley, which finished second in the West Alameda County-Foothill League, stretched its lead to 18 points early in the second quarter before Early attacked the basket with a pair of driving layups to spark a 12-0 Panthers run.

Maybe Williams’ brightly colored, mismatched shoes are truly enchanted, or maybe they just distracted the Yellowjackets as the fleet-footed, high-jumping junior also pulled in seven rebounds, three steals and three assists.

“I just like doing things differently and I think the shoes help me stand out,” Williams said.

Williams and Early drilled back-to-back 3-pointers as San Domenico closed the gap to 23-17 midway through the second quarter.

San Domenico continued to surge as Arthur Mueller and Ika Jokhadze put points on the board, and Jakstas closed the first half with a three-point play. Jakstas drew a foul as he drove through the lane for the basket and hit the ensuing free throw as the Panthers went into the break trailing 28-24.

Sleepy Hollow again awoke to the boisterous cheers from the San Domenico student section as Early hit a turnaround jumper that sparked an 11-1 run to give the Panthers a 35-31 lead in the third quarter.

Berkeley fought back to retake the lead, 36-35 at the end of the third quarter, but could not close the door on the Panthers.

Senior Chidera Onyeukwu, a powerful presence in the paint all night, dropped in a layup and Jakstas calmly hit a 3-pointer to give San Domenico a 44-42 lead in the fourth quarter. Onyeukwu finished with six points and five rebounds.

Berkeley’s Henry Robinson tied the game with a layup, but Williams responded with a 3-pointer with 2 minutes, 20 seconds left, but the Yellowjackets’ Kevon Newman quickly responded with a shot of his own to tie the game at 47 points apiece. Newman led the Yellowjackets with 11 points.

With the clock ticking down, Onyeukwu handed the ball — and the team’s trust — to Williams. Onyeukwu created the space Williams needed to get a clear look at the basket before he calmly lofted up the ball, which dropped through the net for the winning shot.

Berkeley, which hit 11 3-pointers, desperately looked for an open shot in the final seconds to possibly tie the game, but the Yellowjackets had run out of magic and time.

“Our seniors have been preparing for this since Day 1,” Gaffaney said. “These seniors established a culture of hard work. … I know the hard work gets done, even when I’m not around, which really sets the tone.”