The result ends a six-game losing streak, but the Malagasy hit the post late on and had a strong case for a penalty too.
Bafana’s goal came from a piece of magic by substitute Katlego Mphela on 64 minutes, while earlier Siphiwe Tshabalala missed a penalty that should never have been awarded against the visitors.
Madagascar had eight players in the starting line-up making their international debuts, with much of the side made up from the national Under-20 team that won the age-group Cosafa competition last year in Durban.
Morgan Gould got his head on the end of a Siboniso Gaxa cross early on, but too much head as it turned out and the ball went high and wide, while Bongani Khumalo turned the ball over his own crossbar after a good break down the right from the visitors.
Tshabalala played a delightful ball over the top that just eluded the chasing Richard Henyekane, before the Golden Arrows striker tried his luck from 25-yards, with the ball always squirting wide.
A mistake from Khumalo allowed Carolus Andriamahitsinoro to have a shot on goal, which Emille Baron did well to clutch at the second attempt.
Bafana had a soft penalty awarded by Botswana referee Joshua Bondo when on-rushing Madagascar goalkeeper Kandy brought down Henyekane as he chased another long ball. Although contact was made, it was most definitely outside the area.
Santana brought on Mphela at halftime for Siyabonga Nkosi and the Mamelodi Sundowns man forced a routine early save from Kandy, while Khumalo headed over from an excellent Tshabalala delivery from a free-kick.
And Mphela finally put the home side ahead on 65 minutes. An excellent delivery from the right-hand side saw the Downs man time his run perfectly and provide a pin-point finish past a despairing Kandy.
The technique for the goal was the touch of class the Bafana side had been missing up to that point and strengthens Mphela’s claim for a starring role at next year’s World Cup finals.
Sthembiso Ngcobo, Gert Schalkwyk and Daine Klate all entered the fray with 15 minutes to go, replacing Khenyeza, Henyekane and Tshabalala respectively.
Madagascar should have equalised with seven minutes to go. A shot from the right eluded Baron and came back off the post, striking the arm of Siboniso Gaxa as a Malagasy striker chested the ball back towards goal, but curiously, referee Bondo signalled a foul that only he saw.
Peter Pedroncelli, Goal.com