Rival captains Danny Szetela of the Cosmos and Dylan Mares of Miami FC meet before the game. (Photo courtesy of the Cosmos)

UNIONDALE, N.Y. — The National Premier Soccer League final was a tale of two captains.

One captain, Danny Szetela of the Cosmos, made two mistakes within a two-minute span in the opening half.

The other captain, Dylan Mares of Miami FC, turned those errors into goals as the visitors defending their title behind a 3-1 win over the Cosmos at Mitchel Athletic Complex Saturday night.

Mares, named man of the match, tallied twice within a two-minute span in the first half and Shawn Chin added an insurance goal five minutes into second-half added time before a crowd of 5,285.

The Cosmos (16-1-1) had their 17-game unbeaten streak snapped as Miami (15-1-0) won its 14th consecutive match.

“You have disappointment for the fans, the club. You have a final at home,” Cosmos head coach Carlos Mendes said. “There were a lot of good moments for us. We did a lot of good things against a very good team. We made some mistakes. They executed on their chances and we didn’t. That was the difference in the game to me. Credit to them because they were a very good team. They were dangerous and executed when they got the opportunity.

“It can be cruel sometimes, but that’s the way it is. They defended everything. They put numbers behind the ball. It’s never easy. We still found some good situations, some good spots. We have kind of harped all year that we feel that at times we were not sharp enough in executing our chances in the the attacking third and I think tonight it was more of the same.”

Miami FC won the 2018 NPSL crown last year, defeating FC Motown on the road.

“It’s an incredible feeling,” Mares said. “Regardless where we’re at, what we’re doing, trying to win something two years in a row is never easy. I’ve had a history with New York personally. I’m glad to get one back. It was a good feeling. everyone worked hard and we did what we had to do.”

Mares was referring to how the Cosmos denied Miami FC a chance to reach the 2017 North American Soccer League final by upsetting the side in the semifinals.

The game lived up to its hype between the top two ranked teams in the league — No. 1 Cosmos and No. 2 Miami as both sides attacked regularly.

The Cosmos, who hadn’t allowed NPSL foes score more than two goals in a contest this season, surrendered two within a two-minute span midway through the first half.

After the hosts lost the ball at midfield due to a Szetela turnover, Mares picked up the ball at midfield before finding Miguel Gonzalez on the right flank. Gonzalez crossed to Mares in the middle of the box and the Miami captain drilled a shot to the left of goalkeeper Paul Blanchette in the 24th minute.

Miami took advantage of another Szetela turnover to score in the 26th minute. Mares beat Blanchette as the Cosmos found themselves with a 2-0 goal deficit.

Former Albanian national team captain and left back Ansi Agolli, New York’s most dangerous player in the first half, sliced the lead in half in the 31st minute. Agolli sent a free kick just outside the penalty area toward the net just over the head of forward Isaac Acuna and past goalkeeper Mark Pais.

Agolli, who didn’t score a regular-season goal, finished with three in four playoff matches.

The Cosmos kick off the NPSL Members Cup on Saturday, Aug. 10 at Chattanooga FC before hosting the Milwaukee Torrent in their home opener on Saturday, Aug. 17 at 7 p.m.

Le Sueur remembered, honored

Paul Le Sueur, a member of the Cosmos’ first championship team in 1972 who passed away in June, was honored prior to the match. His wife, Liz, and family were named honorary team captains.