The SA men went unbeaten in their six matches and held off a fighting Japanese outfit to book their ticket to London.
The women's side had won an earlier qualifying tournament in Delhi, India, in February.
After going into half-time locked at 0-0 against Japan, the SA men came out firing after the break, soaking up the pressure in a thrilling second period.
The South Africans opened the scoring through a moment of individual brilliance from Thornton McDade 11 minutes into the second stanza.
McDade dribbled through the Japanese defence before rounding the goalkeeper and tapping home into an empty goal to give his side the lead.
Lloyd Norris-Jones stretched the gap with 16 minutes left to play through a counter attack after Japan failed to convert a penalty corner. Norris-Jones fired his back-handed shot at the Japanese 'keeper who deflected the ball before it went in.
Japan hit back and scored through Kenji Kitazato and piled the pressure on SA, who had struggled defensively throughout the tournament.
Goalkeeper Rassie Pieterse made several crucial saves to keep South Africa in the lead, thwarting the Japanese attack as he helped his side secure the last available place for the London Games in July.