Flintoff's six off Paul Harris took England to 198 for four in their second innings.
South Africa won the series 2-1 with victories in the second and third Tests. It was their first series win in England since readmission to international cricket in 1991.
England had moved to 123 without loss before losing three wickets for 20 runs. Makhaya Ntini removed Alastair Cook for 67 and Ian Bell for four, while Harris dismissed Andrew Strauss for 58.
Overcome wobble
Kevin Pietersen, in his first match as captain since taking over from Michael Vaughan, and Paul Collingwood overcame that wobble to steer England to 182-3 when Harris had Pietersen caught for 13.
Collingwood, who resigned as England's limited overs captain last week, stayed calm to end the Test on 25 with Flintoff on 11.
Pietersen later paid tribute to Steve Harmison, whose two-wicket burst in the first innings initiated a South Africa collapse from 103-1 to 194 all out.
"I couldn't have asked for anything more from the players, especially Steve (Harmison)," Pietersen said. "He is a huge factor when it comes to our chances against Australia in the Ashes next year."
Pietersen also expressed confidence in the latest England ploy of playing five bowlers and five batsmen.
"It worked and I'm very happy with it," he said. "I want Fred (Flintoff) batting at six in my side."
Earlier, the England openers had to survive 11 overs of aggressive bowling after resuming on 0-0 having dismissed South Africa for 318 on Sunday evening.
Cook played and missed repeatedly during Ntini's opening overs, while Strauss looked uncomfortable against Morne Morkel's short-pitched deliveries.
Strauss was caught off a Morkel no-ball on four but looked more settled afterward, especially against South Africa's backup bowlers.
After taking 11 overs to add 11 runs, Cook broke loose with two pulls for four in a single over from Ntini.
Cook continued to play positively and brought up his 14th Test 50 in 83 balls with a classic cut past backward square off Jacques Kallis. It was Cook's 10th boundary.
No century
Cook has not made a century in 11 Tests and yesterday he failed again to reach the milestone after a solid start. He had just struck Ntini for his 14th four when he nudged the next delivery to Graeme Smith at slip. It was the ninth time the Essex batsman had been dismissed in the sixties.
Ntini then uprooted Ian Bell's leg stump for four and two balls later Harris dismissed Strauss.
Strauss had reached 58 - his first half century this series - and was looking increasingly confident when he nudged Harris round the corner to Smith fielding at leg stump.
Harris, who had batted defiantly with A.B. de Villiers on Sunday in making 34 in a 95-run stand, failed to extract enough turn and bounce to trouble England's batsmen.
The pick of the bowlers was Ntini with 2-55. After looking out of form and short of pace in the opening draw at Lord's, the 31-year-old South African improved dramatically as the series progressed. He took seven wickets at The Oval following his 18th five-wicket haul in the first innings.