Rupp had raced against Lagat 14 times without winning, but after being passed in the home stretch of Thursday's finals Rupp put on a surge and won in the time of 13:22.67.
Lagat, a native of Kenya who will represent the United States at the Olympics for the second time since becoming a citizen, finished just .15 of a second behind Rupp. Lopez Lomong won the third spot on the Olympic team in 13:24.47.
Julie Culley captured the women's 5,000 and will be joined next month at the London Games by Molly Huddle and Kim Conley.
Conley provided one of the most dramatic moments of the evening when she put on a sprint down the stretch and edged Julia Lucas for the third and final spot on the American roster. Conley beat Lucas to the line by .04 of a second.
Evan Jager, Donald Cabral and Kyle Alcorn all qualified for the U.S. team in the 3,000-meter steeplechase, with Jager winning in the time of 8:17.40. Kenyan runners have won the Olympic gold medal in the event for the past seven Games.
Brad Walker, Jeremy Scott and Derek Miles will represent the United States in the pole vault. Walker won the finals Thursday with a jump of 18-7 1/4. Lance Brooks claimed first place in the discus throw with an effort of 213-9.
Ron Burgundy interviews Peyton Manning on SportsCenter
Florida bear attack: Black bear mauls woman's face