Sock was 3-0 down in the final set and looked exhausted and ragged for much of the match, but his touch, improvisation and fight didn't desert him.
The eighth-seeded Sock's next task is reaching the semifinals.
The No. 8-seeded player defeated Wimbledon finalist Marin Cilic 5-7, 6-2, 7-6 (4) on Tuesday.
Cilic looked set to come out on top when he claimed the first mini-break of the tie-break, but Sock showed incredible athleticism to dart in and guide away a victor after a Cilic shot struck the net cord and he won five points in a row to seal a hard-fought victory. I think it's right and fair that it's indoors, as well.
"That was a tough one for sure", Sock told Sky Sports' Annabel Croft during his on-court interview.
Iran quake toll reaches 422, thousands spend night in open
The Iranian Red Crescent said many areas lacked water and electricity and that aid supplies were being hampered by blocked roads. Seven towns and almost 2,000 villages were damaged, authorities said , and several villages were completely wiped from the map.
"It is frustrating, absolutely, at the beginning of the third set I played well", Cilic said.
Sock, world No 1 Rafael Nadal and Dominic Thiem were all made to exit the building in the middle of a week when they are competing at the end-of-season ATP Finals.
Jack Sock has revealed that he was forced out of his room at 4am on Tuesday morning due to a fire alarm at his hotel. It's an wonderful atmosphere here and I love playing in London and in front of the fans here.
"I think if I do the right things and I play the right tennis, I can give myself a chance to play on the weekend of any tournament", Sock said after the two-hour, 28-minute match.
The Croatian fell to third seed Alexander Zverev on Sunday after leading by a break in the third set.
"I'm just going to try to be a little bit more stubborn in my preparations maybe for the next match, and hopefully next year". I feel really good going into tonight.