The hosts recovered from 153-7 to 224-8, which means that the Proteas would have to make history to earn a series-levelling victory.
Moeen struck three sixes on his way to 67 not out off 59 balls before rain ended play for the day, with England leading by 360 runs after bowling South Africa out for 226 in the visitors' first innings.
Except for Joe Root, who fell short of his second half-century of the match by only a single, none of the England top order was able to take advantage of the home side's superior position in the game.
A fine second spell from Duanne Olivier, who picked up three wickets, was at risk of putting England in danger of letting South Africa back in prior to Moeen's contribution.
England, 2-1 up, are chasing their first home series win against South Africa since 1998.