England, set just 143 to win, reached their target for the loss of only one wicket with 33 balls left.
Opener Alex Hales was 47 not out, his unbroken second-wicket stand with Bairstow worth 98 runs.
But the foundations for a victory which put England 1-0 up in this three-match series were laid by their bowlers.
They restricted South Africa to 142 for three after Proteas skipper AB de Villiers won the toss.
De Villiers made 65 not out and Farhaan Behardien an unbeaten 64 in an innings where fast bowler Mark Wood took two for 36.
The fourth-wicket pair’s unbroken partnership was worth 110 runs after they came together with South Africa 32 for three — which represented a recovery after they had slumped to seven for two.
But South Africa’s total still looked short of a competitive score on what is usually a good batting pitch.
England new-ball duo David Willey and Wood both struck with their opening deliveries.
Left-arm paceman’s Willey’s very first ball of the match saw Jon-Jon Smuts out for a golden duck when he pushed forward tentatively and played on.
Wood then followed suit when Reeza Hendricks pulled his first ball to a leaping Willey at mid-wicket.
Left-hander David Miller advanced down the pitch to drive Willey for six but fell for nine when caught behind off Wood.
Spinners Liam Dawson (four overs for 17 runs) and debutant Mason Crane (four overs for 24) both bowled tidily on their Hampshire home ground. Leg-spinner Crane’s lone really bad ball was his last delivery, a full toss which de Villiers pulled for four. That was South Africa’s first boundary for five-and-a-half overs.
De Villiers, stepping well outside off stump, slog-swept Willey to complete a 49-ball fifty.
Behardien pulled Wood for four for his fifty and next ball hit him straight back over his head for six.
Jason Roy, returning to England duty after being dropped for their Champions Trophy semi-final defeat by eventual title-winners Pakistan in Cardiff last week, was in good touch.
After managing just 51 runs in eight one-day international innings so far this season, Roy made 92 for Surrey in their One-Day Cup semi-final win over Worcestershire last week.
On Wednesday, he struck three sixes — the best a drive off left-arm quick Wayne Parnell.
But on 28 he missed an ambitious reverse-sweep against medium-pacer Andile Phehlukwayo and was plumb lbw.
Bairstow, however, kept the runs coming with big sixes off leg-spinner Imran Tahir and debutant left-arm spinner Tabraiz Shamsi.
South Africa’s day was summed up when Bairstow, on 37, drove Tahir to long-on only for Behardien to drop a routine catch, with the ball going for four.
Tahir’s next delivery was duly smashed for six by Bairstow, who went to a 29-ball fifty by cover-driving Shamsi for four.
The series continues at the Taunton headquarters of southwest county Somerset on Friday before concluding in Cardiff on Sunday.