UNION CITY -- In the final minutes of tonight’s Hudson County Girls Basketball Tournament semifinal, Bayonne huddled together and reminded one another to keep composure and play team defense.

Struggling to find a groove on offense late in the game, the Bees knew their only hope to hold onto what stood as three-point lead over Secaucus was to put forth a consolidated effort defensively — a strategy that stopped the Patriots from scoring in the last two minutes of a 40-34 victory.

“You lift me up. I lift you up,” the girls uttered in the huddle.

The words, simple but effective, quickly came to life on the court as the Bees (21-3), ranked No. 19 in the Star-Ledger Top 20, locked into their stance and forced Secaucus (19-6) to shoot either deep 3-pointers or contested shots near the rim.

The game was hardly a masterpiece, the Bees struggled to execute at times on offense, but as Bayonne coach James Turner said, “I’d rather an ugly win than a pretty loss.” With the victory in the books, the Bees now advance to Saturday’s noon final against Lincoln.

“When your shot’s not falling or you’re turning the ball over, there is one constant in basketball and that’s defense,” said Turner. “You just have to have plain heart and want to stop your girl.

“We may not have played as smart as we should have today and we didn’t shoot as well as we should have, but we did outwork them.”

Early on, the Bees were sparked by senior Aneia Williams, who led Bayonne to a 21-19 lead at halftime. Williams drove and spun her way to the basket throughout the contest, leading to a game-high 17 points.

“I knew we had to have an offensive threat because even though we play solid defense, I know that we can struggle on offense at times. So, I made sure that I was aggressive early on to get us going,” said Williams, who added 10 rebounds, five assists and two steals.

Although the Bees’ scoring slowed down in the second half, Williams received help on the offensive end from Megan Semeniak, Jesenia Montalvo and Madison McGlone, who combined to score 19 points and grab 16 rebounds.

However, the Bees finally separated from the Patriots thanks to their defense, which shut down Secaucus on six different occasions in the second half when the Patriots were within in a single shot of tying the game.

Secaucus was led in the loss by Julia McClure, who had to sit out portions of the fourth quarter due to injury. The junior finished the game with 14 points and 10 rebounds.

Andie Lennon added 10 points for the Patriots, while Alyson Toman had six points and six rebounds.

“Our defense is what is going to win games for us,” Turner said. “I tell the girls all the time that I don’t care how many shots we miss or make, we have to play defense.”