The two finalists meet Sunday and qualify automatically for London. The third through fifth-place teams earn spots in a qualifying tournament just before the games, which will award several more berths for London. Venezuela claimed the fifth-place spot.
Manu Ginobili made the tiebreaking free throw with 58 seconds left for Argentina and Pablo Prigioni added another with 6 seconds to go before Jose Barea of the Dallas Mavericks missed a 3-pointer with a second to play.
"Mission accomplished," Ginobili said. "But we really suffered. It was one of the toughest games of my life."
"Today it was all or nothing," Argentina coach Julio Lamas said. "I feel very emotional about qualifying."
Marcelo Machado led Brazil with 20 points in the semifinal victory with 19 for teammate Marcelo Huerta.
"We have realized a dream," Machado said. "We have worked hard for this, and this is a prize for effort and talent."