The 19-year-old world number 94 saved the match points in the 12th game of the deciding set before racing through the subsequent tiebreak 7-0 against his vastly more experienced opponent.
"To be able to keep it together in tight spots, especially being down two match points, I'm getting a lot better at staying under control," Harrison told reporters.
"At that point, if you lose the match, I just wanted to be able to look back on it and say I took the bull by the horns and lost on my terms."
Harrison struggled to hold serve in the opening game but soon found his rhythm to break Ginepri immediately as he dominated the first set.
The 29-year-old Ginepri, who was ranked as high as world number 15 in 2005, rallied to take the second set 6-2 and both players held firm in the decider until the younger man pulled clear in the closing stages.
Harrison will next face Bulgarian Dimitar Kutrovsky, a 7-5 6-3 winner over American lucky loser Blake Strode, who replaced top seed Gael Monfils in the draw after the Frenchman withdrew from the event due to a right knee injury on Wednesday.
In the final match of the day, Denis Istomin of Uzbekistan eased to a 6-2 6-2 victory over American Michael Russell to set up a quarter-final showdown against second seed and triple San Jose champion Andy Roddick.
Fourth seed and 2009 champion Radek Stepanek of the Czech Republic was the highest-ranked player to fall when he was upset 7-6 7-6 by Belgian Steve Darcis, who next plays Julien Benneteau of France, a 6-2 6-4 winner against Gilles Muller.