WESTPORT — When the Darien and Staples boys basketball teams played to open the season Dec. 22, the Blue Wave squandered a sizeable lead and were unable to recover after rallying late.

The teams met again Saturday in the Wreckers gym and history almost repeated itself. Darien had a 10-point first half lead evaporate, but this time it rallied from a late deficit behind its defense to keep hopes of reaching the state tournament alive.

Pitching a shutout in the last three minutes, Darien defeated Staples 53-48 for its third win in five games. With both teams scrambling to reach the Class LL tournament, Darien (5-8) avenged a 44-43 opening-night defeat.

“We just dug in defensively,” Darien coach Charoy Bentley said. “One thing we preach in practice every day is playing defense. We brought it out here late and (did) what we needed to do and got the win.”

Darien trailed 48-44 late and 48-45 with 2:47 remaining. A floater from Carter Scott and two free throws from Alex Preston gave the Blue Wave the lead for good. Staples held the ball looking to run out the clock in between those possessions, but Preston came up with a crucial block on a shot down low to give Darien possession.

“There was a few other plays where they did the same thing but I picked up the foul,” Preston said. “It was big time to not get the foul and get possession for the team.”

The Wreckers missed a pair of free throws at the other end with 41.8 seconds left. With only three team fouls, Staples was forced to commit multiple fouls to get Darien into the penalty. Despite the hosts coming close to steals on several occasions, Jackson Ryan increased Darien’s lead to 51-48 on two more free throws with 18 seconds left.

“Alex Preston stepped to the line and made his free throws,” Bentley said. “Jackson Ryan did the same thing; they just kept their composure and made their shots.”

Staples got off a potential game-tying 3-pointer with seven seconds on the clock, but it bounced off the rim and into the arms of Preston. He made two more free throws to wrap up the win.

The Wreckers had to overcome a 27-17 deficit late in the second quarter, but did so quickly. Staples closed the first half on a 9-0 run, and scored three points to begin the third to grab the lead. The margin remained at four points or less until Preston’s final free throw.

“(Darien) really came out strong in the first quarter and I think it was an even game until two minutes left in the fourth quarter,” Staples coach Colin Devine said. “They kind of dictated everything at the end of the game. But we fought back.”

Preston led Darien with 16 points while Sean Pritchett (18) and Justin Seideman (16) supplied most of the offense for Staples.

“The game came down to a couple of turning points at the end and we made a few mistakes,” Devine said. “We’ll learn and move on.”

Now the math is simple for the Wreckers: win two of their final five games to reach the Class LL tournament. For Darien, three wins from seven games are required. Staples had won its previous two games against Ludlowe and Norwalk.

“The first game of the year was upsetting for us,” Preston said. “It was a lot like this one; it came out the other way. … This is a big one towards getting eight wins for states; we’re not there yet.”

rlacey@bcnnew.com, @ryanlacey11

DARIEN 53, STAPLES 48

DARIEN (5-8, 3-7 FCIAC)

Justin Jordan 2 0-0 4 Jackson Ryan 2 3-3 9 Alex Preston 5 5-6 16 Carter Scott 3 0-0 7 Zak Swetye 2 0-0 5 Rock Stewart 1 0-0 2 Andrew Stueber 0 0-0 0 William Rolapp 3 0-0 8. Totals: 15 8-9 53.

STAPLES (6-9, 4-7 FCIAC)

Justin Seideman 4 6-7 16 Sean Pritchett 6 6-8 18 Dylan Dreyfuss 1 0-0 2 Jared Vishno 0 0-0 0 Brendan Massoud 2 0-0 4 Thomas Jones 0 0-0 0 Max Sussman 3 0-0 9. Totals: 16 12-15 48.

DARIEN 16 11 8 18—53

STAPLES 12 14 12 10—48

3-pointers: D—Swetye, Preston, Scott, Ryan 2, Rolapp 2; S—Seideman, Sussman 3.