The spin pair took four apiece, with two at the end from captain Joe Root's off-breaks, as they dismissed the hosts for just 126 on the fourth afternoon.
While that was a fine effort in the field it also gave fair warning that those runs, added to an existing lead of 37, would not be easy to come by.
At 78 for eight England were probably heavy favourites, but a free-spirited knock of 40 from tailender Lasith Embuldeniya changed the tone again.
Having taken seven wickets in England's first innings, Embuldeniya's work has only just begun.
The day began with the swift demise of England's innings, with five runs added before Dilruwan Perera had Leach lbw.
The pressure was on Leach and Bess, who had gone 64 overs without a single scalp in the first innings, and they responded in style to pick up respective figures of four for 59 and four for 49.
Leach was into the game after a token four overs of seam from James Anderson and Sam Curran.
The left-armer sent down 228 balls without joy earlier in the match but struck gold with his second delivery here, Kusal Perera kneeling down in pursuit of a big slog sweep to fall lbw despite being struck on the midriff.
Bess took a little longer to find his radar but when he did, attacking the off-stump line with drift and turn, Oshada Fernando was only able to offer a bog standard bat-pad chance to Zak Crawley at short-leg.
If that was an easy grab for Crawley, his next effort was a much tougher one, Lahiru Thirimanne flicking Leach cleanly off the face only for a sharp reaction grab as the Kent player stayed low under the helmet.
From 37 for three a collective madness took hold as the next three batsmen tried and failed to hack the team out of bother.
Angelo Mathews, a persistent thorn in England's side in this series and over several years, started proactively but paid the price quickly.
Trying to launch Bess over midwicket he was beaten through the air then lost his off stump as the ball spun sharply off the surface.
Captain Dinesh Chandimal hit two boundaries off Leach but could not resist going for a third, launching a swirling catch up in the air as Anderson steadied himself before a nerveless take dropping over his shoulder.
Niroshan Dickwella, fresh from his career-best 92, then drilled Bess to Dan Lawrence at cover for the latest example of muddled thinking.
Root could have made the lunch equation even better but let a couple of chances slip at the end of the session, reprieving Ramesh Mendis and Dilruwan.
England continued their dominance after lunch, Dilruwan flicking Bess to Crawley at short-leg and Mendis becoming the latest victim of the sweep when he under-edged Leach into his boot. Jos Buttler was on hand to nip in front of the stumps and gather the catch.
Sri Lanka had barely threatened to reverse the pressure but Embuldeniya came from nowhere to chance his arm with a near run-a-ball 40.
There were six fours as well as a six from Leach but he was dropped twice, by Jonny Bairstow and Bess, before Root gambled on his own part-time spin to remove him and Asitha Fernando with successive deliveries.