Matt Lewis connected for the game-winner in the second half. (Photo courtesy of the Cosmos)

MILWAUKEE – Facing an early one-goal deficit against the Milwaukee Torrent Saturday night, the Cosmos did the right thing. They used their heads to rally for an important NPSL Members Cup victory.

Shavon John-Brown equalized with his first goal as a Cosmos and Matt Lewis headed home the game-winner in the 47th minute en route to a 2-1 victory at rain-swept Hart Park.

The Cosmos (6-0-2, 20 points) remained in first place over Detroit City FC (5-0-1, 16), which registered a 1-0 away win at Chattanooga FC Saturday night to keep the race tight. Those results set up a classic confrontation for the league title at Mitchel Athletic Complex in Uniondale, N.Y. on Saturday, Oct. 12 at 7 p.m. Detroit, which must play four games over the next two weeks, has two games in hand on the Cosmos.

The fifth-place Torrent (1-4-2, 4), which was sanctioned a point by the league, tallied in the 11th minute as Sebastian Capozucchi beat goalkeeper Santiago Castano from in-close off a free kick for a 1-0 edge.

Although the Cosmos enjoyed a sizable possession advantage in opening half, they could not convert until John-Brown scored off a pretty play in the 41st minute. An overlapping Ansi Agolli flipped a long cross from the left flank into the box and the Grenada international headed in his first goal to knot things up at 1-1.

Only two minutes into the second half, Lewis scored his first goal of the Members Cup season, heading in Darwin Espinal’s corner kick past former Cosmos goalkeeper Kevin Tenjo for a 2-1 advantage.

After the Detroit match, the Cosmos will visit Napa Valley 1839 FC in their regular-season finale on Saturday, Oct. 19.