Inter Miami CF goalkeeper Nick Marsman checks on New York City FC forward Valentin Castellanos (11) after colliding with him in the second half. (Wendell Cruz-USA T(ODAY Sports)

Valentin (Taty) Castellanos tallied twice in the opening half to power New York City FC to a 2-0 victory over Inter Miami CF at Red Bull Arena Saturday night.

The win helped second-place City (9-5-4, 31 points) increase its unbeaten streak to six games while the hosts snapped 12th-place Miami’s (4-9-4, 16) undefeated streak at four matches.

Castellanos, who struggled without a goal over a two-month span earlier this MLS season, has found his scoring touch. He has scored five goals in his last six games.

“I am very happy for the win front and foremost, and for the goals as well,” Castellanos said. “I’m always looking to score goals, every single game, and when it comes to confidence, I’m always confident.”

He gave NYCFC all the scoring it needed in the 21st minute as he headed home a Maxi Moralez cross past goalkeeper Nick Marsman.

“It was really great play, we played from behind as well,” NYCFC head coach Ronny Deila said. “We switched the play, the pass from Maxi was superb, and the finish, I don’t need to say anything about that – it was top, top class. He’s difficult to play against.”

A minute into first-half stoppage time, Castellanos doubled the lead by converting a penalty kick with a Panenka move after Kelvin Leerdam was called for handball in the box.

Asked when he decided to try a Panenka, Castellano replied, “These are the type of things we decide in the moment, I knew that lately I have been doing good at those, and when I saw the opportunity I seized it, and I was able to score exactly as planned.”

Goalkeeper Sean Johnson recorded the clean sheet.

NYCFC’s secret?

“Defend as a team,” Deila said.  ‘We have done that all season. The teams that played us were effective, but we have a great defense and a great goalkeeper too. The big difference from last season is that the whole team is defending together. It’s not three up front walking back, its compact, its together. It’s very clear who has different roles, and they execute it in a really good way. And that team spirit is really hard to break down, and it’s hard to create chances on us. “