Korolev had a 5-2 lead and a 40-15 advantage in the eighth game of the second set, but the 13th-ranked Gonzalez rallied to win the game and won the next three as well for a 6-5 lead capped by a shutout victory in the 11th game.
But Korolev won the 12th game to force the tiebreak and broke a 4-4 tie by winning three consecutive points to end the match in 1 hour, 37 minutes. In total, it took 11 match-point attempts for Korolev to finally eliminate Gonzalez.
"It was just fighting," Korolev said. "I can't remember [anything real well] because I was so into the game. But every point was really tough. Luck was on my side.
"Sure, it gets frustrating after losing 10 match points," he said. "When it was 5-3 and I had a 40-15 lead, I got a little frustrated and started to shake a little bit. So, it's good I found my energy and focus at the end so I could finish the match in my way."
Korolev, ranked 100th in the world, broke a 2-2 tie in the second set by winning three straight games for a 5-2 lead. He never trailed during the 36-minute first set.
In their only previous meeting, Gonzalez beat Korolev in four sets in the 2007 Australian Open. Korolev made the semifinals in Las Vegas last year and has reached his second quarterfinal this year.
Korolev will face South African qualifier Kevin Anderson, a 7-6 (2), 7-5 winner over American wild card John Isner. Ginepri will play Latvia's Ernests Gulbis, a 6-2, 6-1 winner over Australian qualifier Peter Luczak.
In the other quarterfinals, fourth-seeded Guillermo Canas of Argentina will face Amer Delic and Sam Querrey will meet Julien Benneteau, the Frenchman who beat second-seeded Lleyton Hewitt on Wednesday night.