The Australian leg-spinner took 5-32 as the hosts were dismissed for 217 in their first innings, with Jim Troughton contributing 103 of those runs.
Warne then declared with his side on 218 for six, setting Warwickshire 407 for victory. They were 69 for two at stumps.
Durham will look to set Middlesex a tough target at Chester-le-Street after Graham Onions impressed on day two.
Onions was the not out batsman in Durham's first-innings total of 348, then was the pick of the bowlers with four for 82 as the visitors were dismissed for 242.
The hosts lost Jimmy Maher and Gordon Muchall before stumps but, at 80 for two, they had a 186-run lead in their second effort.
In Division Two, Jon Lewis made up for the disappointment of missing out on England's Test XI earlier in the day by putting Gloucestershire on the brink of victory against Northamptonshire in Bristol.
Ian Harvey's century helped the hosts reach 232 in their first innings, a lead of just 13 runs.
Lewis then took five wickets for 36 runs to dismiss Northamptonshire for 114. Chasing 102 to win, Gloucestershire were eight for one at stumps on day two after losing Craig Spearman.
Andy Flower and Ronnie Irani recorded centuries to put Essex's clash against Somerset in the balance at Hove.
Keith Parsons and Peter Trego had earlier reached three figures as the hosts posted a first-innings total of 471.
Essex were 80 for three until Flower (104no) and Irani (108no) shared an unbeaten fourth-wicket stand to reach 282 for three at stumps on the second day.