Siphiwe Tshabalala scored the opener with a great free-kick into the top corner in the 42nd minute.
Tokelo Rantie and substitute Mzikayise Mashaba made it three in the second half.
The victory makes it a 50th cap to remember for right-back Siboniso Gaxa.
Man of match May Mahlangu had an impressive match in the heart of midfield, driving at the Gabonese defence early in the game.
The Swedish-based midfielder tried his luck from range with a powerful effort towards the end of the match, after spotting the keeper off his line, but his shot was over the bar.
With seven changes to the side that drew with Botswana, South Africa dominated possession from the start, but wasted a number of chances in the first half.
Reneilwe Letsholonyane, who had a fairly solid match in the middle of the park, had the first chance in the 15th minute, but his attempted lofted shot was just over the bar.
Despite playing with just Rantie up front, Bafana were the more attacking side. Gabon, who were using the match to have a look at a prospective Olympic squad, were pinned back in their half.
Teko Modise came agonisingly close on 20 minutes, but after a one-on-one with the keeper his shot was tipped wide.
From the resulting corner-kick Morgan Gould came close with a header that went just past the post.
A few minutes later Rantie got on the end of a ball in the penalty area, but struck his shot into the stands.
Modise had another chance on half an hour, but for the second time in as many weeks he skied the ball way over the bar, despite having plenty of time for the shot.
On 40 minutes Rantie was fouled just outside the box, after a good run through the middle.
'Shabba' stepped up for the free-kick, and found the left top corner with a trademark left-foot shot, handing Bafana a much-needed lead going into half-time.
In the second half, Rantie's run got him on the end of a perfectly-weighted pass from second-half substitute Thulani Serero, which he cooly powered home to make it 2-0.
Eight minutes later, after some fantastic build-up play, Siyabonga Nomvete laid the ball on to Mashaba, who poked it past the Gabon keeper with the outside of his boot to seal the win.
Caretaker coach Steve Komphela, who said before the match that he was going to be doing some experimenting, will hope the result counts in his favour as Safa look for their new Bafana Bafana coach.
South Africa starting XI: Khune, Gaxa, Masenamelala, Mathoho, Gould, Modise, Tshabalala, Letsholonyane, Mahlangu, Mokoena, Rantie