Lucky Mkosana was the nearest option for Cosmos forward Haji Wright, who ended a game of header pinball by knocking down the ball in the box.
Mkosana also was the best option, as he turned around and shot the ball low into the left part of the net in the 85th minute to put his team ahead against the Carolina RailHawks.
It was the go-ahead goal and the final one as the Cosmos beat the RailHawks, 3-2, on Sunday at Hofstra's Shuart Stadium. The Cosmos extended their unbeaten streak to eight games and are 5-0-3 in that span.
Cosmos coach Giovanni Savarese said Mkosana did "everything" well and also praised Raul Gonzalez Blanco, who scored on a penalty kick and had an assist.
"It was a complete performance by Lucky today. From holding, attacking, making it difficult, scoring a goal, being positive, everything," Savarese said before adding of Gonzalez Blanco: "Raul is just a guy that reads things before everyone else."
Savarese said the win was a difficult one, adding that his team was overconfident once Andres Flores scored on a set piece in the second minute of the game.
The Cosmos dominated for the first 20 minutes of play, looking strong on the ball and creating space, but couldn't capitalize on quality chances.
Walter Restrepo fed Mkosana on a 2-on-0 in the 17th minute, but Mkosana couldn't get a shot off after a physical defender caught up with him around the 12-yard line.
The RailHawks broke through in the 23rd minute, tying the score at 1 when midfielder Tiyi Shipalane burned a defender on a hesitation move and fed Nazmi Albadawi for the goal.
The two connected again in the 42nd minute and Albadawi made it 2-1 on a goal from inside the 18-yard line.
The RailHawks had momentum out of the half and were more physical, but it cost them when Mkosana drew a foul inside the box in the 61st minute, earning a penalty kick. It was taken by Gonzalez Blanco, who scored to tie it at 2.
The RailHawks ramped up the physicality again and captain Daniel Scott got a red card for his contact with Mkosana, who was taken down in the box a few minutes later. Gonzalez Blanco's shot hit off the post this time.
"It's great for us because I know we're never out of it," Cosmos midfielder Leo Fernandes said. "Toward the end of the game, other teams get tired and I feel we get stronger."