John Wolyniec won it in the 80th minute for New York when he latched onto a deflected cross and belted a shot past Quakes keeper Andrew Weber.
New York struck in the second minute to take a 1-0 lead when San Jose failed to clear a corner kick and it caromed off Wolyniec for defender Mike Petke to bang home from eight yards out. It took more than an hour for the Quakes to equalize, which they did in bizarre fashion when Pablo Campos ran onto a throw-in and took it all the way to the edge of the penalty area before firing past goalie Danny Cepero to tie the score.
New York advances to play D.C. United, with the venue and date to be determined. The winner earns a chance to qualify for the round-of-16.
Though the teams generated just 15 shots combined, there were numerous near-misses in addition to the three goals. In the opening minutes Wolyniec failed to put away a rebound when Weber blocked a shot by Macoumba Kandji, and midway through the half Wolyniec headed a cross from Carlos Johnson well wide.
San Jose responded and nearly took the lead a few minutes later when Quincy Amarikwa's cross turned into a shot and struck the inside of the far post and back into play before being cleared. Kandji threatened again in the next minute by intercepting a pass and slid the ball past Weber and just outside the post.
Before the half ended, Cepero saved from Amarikwa and Shea Salinas drilled a good pass from Amarikwa over the crossbar.
In the 71st minute, Chris Leitch lobbed a throw-in for Campos to take deep into the Red Bulls defensive third and fire a low shot past Cepero.
But New York was soon back on top. In the 80th minute, a cross from Dominic Oduro deflected off Eric Denton and fell to Wolyniec inside the six-yard box. Wolyniec poked it past Weber for a 2-1 Red Bulls lead they would not relinquish.
League play for both teams resumes Saturday. New York heads down the coast to play Los Angeles at Home Depot Center, whose other tenant, Chivas USA, travels north for a meeting with the Quakes.
U.S. Open Cup
April 29 in Santa Clara, Calif.
San Jose 1, New York 2
Goals: Campos 71; Petke 2, Wolyniec (Oduro) 80.
San Jose -- Weber, Leitch, Denton, Gray, Zaher, Salinas, Elliott, McDonald (Alvarez 83), R. Johnson (Convey 59), Amarikwa, Davide Somma (Campos 46).
New York -- Cepero, C. Johnson, Boyens, Petke, Borman, Ubiparipovic, Pietravallo, Sassano, Oduro (Hall 86), Kandji (Mbuta 56), Wolyniec.
Referee: Alejandro Mariscal.