As time was running down in regulation, Danny Szetela admitted to himself he was tired and wasn’t about to play a half hour of extra time.

So, he did something about it, connecting on a dramatic header in the 88th minute to boost the Cosmos to a 1-0 win over New York City FC Wednesday night in the fourth round of the Lamar Hunt/U.S. Open Cup at Jack Coffey Field at Fordham University.

“I looked at the clock. My legs are tired,” he said. “I’m not going to overtime. The next time the ball gets out wide, I’m always going to make that run that i always make down the middle.”

The Cosmos eliminated City for the second consecutive year in the competition and defeated a Major League Soccer team for the third year in a row, beating the Red Bulls in 2014.

“We want to be the kings of New York,” Szetela said. “It’s a great feeling.”

The Cosmos will find out Thursday who they will meet in the fifth round on June 29 when U.S. Soccer holds the draw for that round.

advertisement | advertise on newsday

Szetela certainly wouldn’t mind meeting the Red Bulls, who defeated the Cosmos in the fifth round last year, 4-1.

“I would love to play the Red Bulls,” he said. “Growing up in New Jersey I was always a MetroStars fan and then they became the Red Bulls. Now my heart is with the Cosmos. Last year they beat us 4-1, a score line I didn’t think was correct.

“We will play D.C., Philly or the Red Bulls. That’s the challenge you want. We don’t want to play a USL team. We want to play MLS teams. We want to prove we can be the best in this country.”

The winning goal started on a City turnover. Second-half substitute Adam Moffat started the counterattack with a pass to Yohandry Orozco, who bolted down the field. Orozco then crossed the ball to Szetela at the right post and he headed it home from point-blank range past goalkeeper Eirik Johansen.

“I just attacked the ball and finished it,” Szetela said.

@Newsday

If Szetela made the offensive play of the match, Hunter Freeman made the defensive play in the 73rd minute. After goalkeeper Jimmy Maurer bobbled the ball, City forward Patrick Mullins fired a shot at empty net that Freeman slid to save.

City’s futility in derby matches continued as its record fell to 0-5-1 over two years.