The pair, who split the 400 medley and 200 freestyle finals, set up a deciding third race on Saturday when they registered the fastest two times in the semis.
Racing in adjacent lanes, Lochte got his hand on the wall first in a time of one minute 55.51 seconds with Phelps easing up on the last lap to take second in 1:56.66.
"Tonight it was just about getting a lane in the final, but tomorrow's going to be a dogfight," said Lochte, who posted the fastest qualifying time in the 200m backstroke semis less than an hour before squaring off with Phelps.
Lochte has already qualified for two individual events and has the chance to add two more on Saturday, which would give him a total of five in London with the addition of the 4x200m freestyle relay.
Phelps has already qualified for three individual events and in addition to the 200m medley he also has the 100m butterfly to come.
The 14-time Olympic gold medallist will be an automatic selection in the three relays.
Nathan Adrian clinched his place in the team for London when he won the men's 100m freestyle final in 48.10 seconds, ahead of Cullen Jones, Matt Grevers and Ricky Berens, who all made the 4x100m freestyle relay.
Jason Lezak, the 36-year-old whose stunning anchor leg in Beijing was pivotal in Phelps getting his eight gold medals, finished sixth to force his way into the relay squad.
Lezak only got into the final when Lochte pulled out to conserve his energy for the backstroke and medley semis.
The US automatically picks the top six for the relays but can use a maximum of eight swimmers, four in the heats and four in the finals, from anyone on the team.
"It was a big race for me, I trained four years for this," Lezak said.
"It's a pretty good accomplishment to get in there. Even though it's sixth place, still made the team.
Natalie Coughlin and Amanda Beard, two of the stalwarts of the American's women's team, were both clinging to the hope they could also sneak on the team with one event left each.
Beard, bidding for a fifth Olympics, needs to finish first or second in Saturday's 200m breaststroke final. She qualified fifth.
Coughlin qualified seventh fastest for the 100m freestyle final and needs to finish in the top six to make her third Olympics.
"Life will go on. That's why you don't see me freaking out," Coughlin said.
"This meet is kind of a horrible meet. It's super exciting for the people making the team, but there is so much stress and anxiety in the air."
Scott Weltz and Clark Burckle qualified for their first Olympics when they finished one-two in the men's 200 breaststroke final.
Seventh after the first lap, Weltz stormed home on the last length to win in 2:09.01 with Burckle (2:09.97) holding off cancer survivor Eric Shanteau and former world record holder Brendan Hansen, who qualified in the 100m breaststroke.
"When I turned at the 100, I just said to myself 'I can do this, I can do this,' and I didn't feel a thing after that," Weltz said.
Cammile Adams won the women's 200m butterfly final in 2:06.52 with Kathleen Hersey second in 2:07.72.