The Kiwi-born allrounder will resume on Tuesday at the WACA on 72 in pursuit of his maiden Test hundred with England 5-251 after Australia set a target of 504 to win.
Stokes has taken the fight to the Aussies, hitting 12 fours off 96 balls.
A fourth-day result looked likely when Ryan Harris bowled Alastair Cook from the first delivery of England's second innings. Cook became the first player to make a golden duck in his 100th Test.
Michael Carberry (31) got a start for the second time in the match before he was out lbw to Shane Watson.
Wicketkeeper Brad Haddin took a diving catch to remove Joe Root off Mitchell Johnson's bowling at 3-76.
Root bizarrely called for a review which showed it wasn't a bump ball and had to depart.
Star No.4 Kevin Pietersen, for all his ability and shot-making panache, fell for 45 just when he side needed a long innings from him.
After hitting Nathan Lyon over long-on in the 38th over, Pietersen couldn't resist another attempt during the spinner's next over and holed out.
Carberry defended Pietersen after the 102-Test veteran played a loose shot to mid-on to get out for 19 in England's first innings, saying it was a shot Pietersen often hits out of the ground.
Ian Bell's shot selection could also be questioned after the middle-order gun tried an upper cut and was caught behind for 60 off the bowling of Peter Siddle. Umpire Marais Erasmus rejected Australia's appeal but it was overturned on review.
Bell and Stokes added 99 for the fifth wicket.
The exit of Bell at 5-220 gave Australia the chance to push for victory late on day four, but Matt Prior remains unbeaten on seven.
The ability of England's tail to wag will be severely tested by the pitch's variable bounce and also the injury to No.9 Stuart Broad, who has a bruised foot.
Australia declared on 6-369 after Shane Watson (103) joined opener David Warner (112) as century-makers in the home side's second innings.
Resuming on Monday on 3-235, Australia blasted 134 runs in 17 overs.
Watson crunched 11 fours and five sixes, moving from a half-century to a triple figures in 28 balls.
George Bailey smashed an unbeaten 39 including a world record-equalling 28 off the final over of the innings bowled by Jimmy Anderson.
Australia lead the five-match series 2-0.
AUSTRALIA FIRST INNINGS 385
ENGLAND FIRST INNINGS 251
AUSTRALIA SECOND INNINGS
C ROGERS c Carberry b Bresnan 54 (135)
D WARNER c Stokes b Swann 112 (140)
S WATSON run out (Bresnan) 103 (108)
M CLARKE b Stokes 23 (53)
S SMITH c (sub) b Stokes 15 (50)
G BAILEY not out 39 (30)
B HADDIN c Swann b Bresnan 5 (6)
M JOHNSON not out 0 (0)
Sundries (8b 5lb 5w) 18
Six wickets (dec) for 369
Fall: 157 (Rogers), 183 (Warner), 223 (Clarke), 301 (Smith), 331 (Watson), 340 (Haddin).
Bowling: J Anderson 19-5-105-0 (1w/5), T Bresnan 14-3-53-2, B Stokes 18-1-82-2, G Swann 27-8-92-1, J Root 9-1-24-0.
Batting time: 355 mins. Overs: 87.
ENGLAND SECOND INNINGS
A COOK b Harris 0 (1)
M CARBERRY lbw Watson 31 (53)
J ROOT c Haddin b Johnson 19 (88)
K PIETERSEN c Harris b Lyon 45 (57)
I BELL c Haddin b Siddle 60 (93)
B STOKES not out 72 (96)
M PRIOR not out 7 (14)
Sundries (1b 11lb 5w) 17
Five wickets for 251
Fall: 0 (Cook), 62 (Carberry), 76 (Root), 121 (Pietersen), 220 (Bell).
Bowling: R Harris 10-1-51-1, M Johnson 15-3-52-1 (1w/5), N Lyon 15-2-49-1, P Siddle 18-6-56-1, S Watson 9-1-31-1.
Batting time: 300 mins. Overs: 67.
Umpires: Billy Bowden (NZL), Marais Erasmus (RSA).