The pace spearhead lured Marvan Atapattu into a trap for his favoured hook shot and then bowled first-innings centurion Mahela Jayawardene next ball to put the Australians in the box seat for victory on Tuesday's final day.
Sri Lanka's hopes will now rest on Kumar Sangakkara, who reached his 15th Test hundred late in the day.
The Sri Lankans still need 260 runs with seven wickets in hand for a stunning come-from-behind win.
The Australians are looking for another convincing victory to wrap up what has been a lopsided series after romping to an innings and 40-run win in Brisbane.
Australia are closing in on their 14th consecutive Test victory, the sequence beginning against South Africa in Melbourne in December 2005.
At the close, Sangakkara was unbeaten on 109 in 292 minutes with Sanath Jayasuriya not out 33 in an unbroken 89-run stand.
Sri Lanka were 247 for three.
Lee, Australia's outstanding bowler of the two-match series with 14 wickets so far, broke Atapattu's stubborn