Faced with a one-goal deficit to Rayo OKC midway through the second half Saturday night, Cosmos head coach Giovanni Savarese never had any doubts about his team emerging with a victory.

“All along I believed the guys were going to pull it out and get the victory,” he said. “There was never a doubt the guys were going to put it out.”

The Cosmos did — in dramatic fashion. Juan Arango connected for the equalizer in the 73rd minute and set up Yohandry Orzoco’s game-winner in the 90th minute to register a 2-1 win in the North American Soccer League semifinals before 5,023 spectators at Shuart Stadium.

The Cosmos, who extended their home unbeaten streak to 20 games, will host Indy Eleven, 1-0 winners over FC Edmonton for the league title at Belson Stadium at St. John’s University, next Sunday.

“I’m just proud of the guys just to be able to come back and go to the final,” Savarese said.

Arango was an invisible man for most of the game until he performed his heroics. He found space between two defenders and headed an Ayoze corner kick from eight yards in the 73rd minute.

advertisement | advertise on newsday

Ayoze started the sequence on the winner, sending a pass to Arango in the corner as the Venezuelan international drilled a left-wing cross to Orozco in the middle of the box before beating goalkeeper Daniel Fernandes.

“He’s a player who can disappear at time, but he’s somebody who can make a difference in the game. He did a great job.”

It was the Cosmos’ last game at Shuart, their venue since returning to competitive soccer in 2013. Next year they will find a new home.

“There are feelings,” Savarese said. “I told the players they had such a great history here. We had to close it out in a special way.”

Both teams played immaculate soccer on defense in the opening half as both goalkeepers rarely were tested. Many shots were blocked at the point of where they were taken as the Cosmos and Rayo had trouble breaking their foes’ backlines.

@NewsdaySports

Rayo finally broke the ice in the 37th minute as midfielder Michel sent a 40-yard free kick into the center of the penalty area to Gambia international defender Futty Danso, who headed the ball from 12 yards past a diving Jimmy Maurer and into the lower left corner for a 1-0 lead.