DARIEN — The moment was as tense it gets in girls tennis —  third set, match on the line against a league contender, fading light, teammates cheering from the fence — but Darien’s Caroline Homes and Daniella Castellanos were cool and calm on the court.

Or maybe not.

“I was so freaked out,” Homes admitted with a smile. “I was so scared that I was going to be the one to mess the whole thing up.”

Relaxed or not, the Blue Wave duo got it done.

Homes and Castellanos overcame Greenwich’s Catherine Daye and Rachael Karetsky in a fantastic match at No. 3 doubles, as Darien edged the Cardinals 4-3 Thursday at Darien High School.

The Greenwich pair won the first set but Darien came back to win in three 2-6, 6-1, 7-5.

It was a fitting end to a long afternoon of tennis, as the match lasted three hours and ended with the last of the day’s sunlight nearly gone.

The Wave (3-0) hasn’t lost to Greenwich (2-1) since 2014, but this one was a narrow escape.

“Greenwich is a really strong team this year and I knew it was going to be tough,” Darien head coach Anne-Lise Brown said. “I didn’t know it was going to be that tight at the end, but that’s the sign of a good match with two strong teams. We’ll probably see them again in the postseason.”

“We gave a great fight,” Greenwich head coach Betsy Underhill said. “We haven’t come this close to them in years, so to come down to a couple of points, I feel like we did great. The fact that we gave this kind of performance today shows that next time, it can go either way.”

Greenwich had the advantage in singles, winning three of four matches, while Darien swept the three doubles contests and had a win from sophomore Emily Wiley over Cardinals’ senior co-captain Martine Fierro at No. 1 singles to get the overall victory.

With the match score tied at 3-3, the spotlight turned to Homes and Castellanos, Darien’s sophomore pair, as they took on Greenwich senior Daye and junior Karetsky.

The Cardinals had the early edge at 4-2 in the decisive third set, but Homes and Castellanos battled back to take the next three games for a 5-4 advantage. After Greenwich tied it at 5-5, Darien responded with a win to go up 6-5.

In the final game, Daye and Karetsky fought off two match points, and came within a point of forcing a tiebreaker before the Wave duo nailed down the win.

“We always talk about this kind of match,” Castellanos said. “It’s not our favorite, but we try to not let it get to us. We just want to play and pretend like nothing’s happening. It’s just another match.”

“Caroline and Daniella have matured from their freshman year where they were nervous a lot,” Brown. “They know each other’s game well, they play well together, and they can really hang in there when it gets tight. There was a lot of pressure and everyone was screaming, but they played well.”

“Rachael just came up from the JV and was playing in that last match and Catherine just came to our team last year, and they put up a great fight in that match,” Underhill said. “Our whole team did. You can’t feel bad. They played great and it was just a great day of high school tennis.”

The score seesawed throughout the afternoon.

No. 2 doubles was first off the courts, with Blue Wave senior co-captain Quin Wolters and junior Caroline Hojsgaard defeating sophomore Abby Shropshire and junior Hannah Viney 6-1, 6-0.

Greenwich’s Nathalie Williams then defeated Darien’s Katie Wiley in a battle of sophomores at No. 2 singles 6-1, 6-0.

Darien’s No. 1 tandem of senior co-captain Juliet Homes and junior Elaina Cummiskey topped Greenwich juniors Amy Bickham and Yui Inagawa 6-4, 6-3; but the Cards tied it at 2-2 when senior co-captain Christina Gianesello defeated Darien junior Abby Stravato 6-3, 6-3 at No. 3 singles.

Emily Wiley then finished off a two-set sweep of Fierro at No. 1 singles, as she edged the Greenwich ace in the first set and won, 7-5, 6-3.

“Martine (Fierro) is very tough and they do play each other a lot year-round,” Brown said. “So they’re both familiar with each other’s games and today, it was just a matter of who could hang in there the longest. To do it in straight sets was a great win for Emily.”

At that point, two matches remained on the courts, and Greenwich junior Kendall Schrohe defeated Darien freshman Cameron Cavanna at No. 4 singles 6-3, 6-3.

That moved all eyes to the No. 3 doubles match, where Caroline Homes and Castellanos finished off the win.

“It was a lot of pressure,” Homes said. “Me and Daniella are very nervous under pressure. I’m surprised that we were able to win that. I’m very proud of Daniella.”

“Honestly, all I can say is I’m so glad she’s my partner,” Castellanos said. “Because I could not have done that without her.”

Both teams walked away with a lot to build on.

“I think we’ll be in contention for something,” Underhill said of her Cardinals. “Staples has a good team, so we still have to see what happens with that one, but we’re right up there with any of the top teams. Because we haven’t been so close to Darien in many years, there’s a mental thing in a match like this. So the fact that we were this close today proves to them that we could do this.”

“The cheering and hugging at the end and that stuff definitely pulls them together,” Brown said. “They’re already tight and they’ve had a lot of bonding time together, but this is a great experience for them. This will be huge for their confidence.”

DARIEN 4, GREENWICH 3

(at Darien): Singles: Emily Wiley (D) def. Martine Fierro 7-5, 6-3; Nathalie Williams (G) def. Katie Wiley 6-1, 6-0; Christina Gianesello (G) def. Abby Stravato 6-3, 6-3; Kendall Schrohe (G) def. Cameron Cavanna 6-3, 6-3; Doubles: Juliet Homes and Elaina Cummiskey (D) def. Amy Bickham and Yui Inagawa 6-4, 6-3; Quin Wolters and Caroline Hojsgaard (D) def. Abby Shropshire and Hannah Viney 6-1, 6-0; Caroline Homes and Daniella Castellanos (D) def. Rachael Karetsky and Catherine Daye 2-6, 6-1, 7-5

Records: Greenwich (2-1), Darien (3-0)