HARRISON, N.J. — If New York City FC is going to make an impact in the MLS Eastern Conference race this season, the team is going to have to find a way to beat its archrival.

City continued its woes against the Red Bulls, this time in the Lamar Hunt/U.S. Open Cup at Red Bull Arena as it was eliminated in the fourth round via a 1-0 loss Wednesday night.

In seven confrontations between these two Hudson River Derby rivals since 2015, NYCFC has won only once (1-6).

Asked why his team has problems with the Red Bulls, NYCFC coach Patrick Vieira replied: “I think it’s a fantastic challenge a really good challenge for myself, the players. So that will make the next games more exciting and more challenging for us.”

It turned out to be a game of two halves. City dominated the opening 45 minutes behind Maxi Moralez, who came out at halftime because of a calf problem.

“They did play better in the second half, the same way we played better in the first half,” Vieira said. “They took their chances. We didn’t take our chances. In a game like that, you don’t take your chances, you can get punished.”

Second-half substitute Daniel Royer did the punishing, striking for the game-winner in the 67th minute. Goalkeeper Sean Johnson denied Bradley Wright-Phillips in front of the net. The ball popped out to Royer, who volleyed the ball into the left corner on one bounce.

advertisement | advertise on newsday

The Red Bulls will discover their June 28 fifth-round opponent Thursday. NYCFC, which was eliminated in their first game for the third consecutive year, will focus on preparing to host defending MLS champions Seattle Sounders at Yankee Stadium Saturday.

It was a frustrating night for City, which hit the woodwork three times. Tommy McNamara’s shot bounced off the crossbar twice in the 16th minute and David Villa rammed one off the left post in the 40th minute.

NYCFC will have three more opportunities to get its act together against the Red Bulls. They will tussle here June 24, play at Yankee Stadium Aug. 6 and return to Red Bull Arena Aug 25.

“The derby in the league and in the cup, you always want to win it,” Vieria said. “When you look at the Starting XI at both teams, you could see both teams want to win the game. It could have an impact on the next league game.”