After his side had resumed on 167 for six, Joyce was eventually caught by Stephen Fleming off Ryan Sidebottom for 192 - with Middlesex all out for 345 on the third day of the four day match.
Fleming, who made only one run to add to his first-innings duck, did not enforce the follow-on and then declared at 212 for five to set his former club 414 to win. They were eight without loss at stumps.
In Division Two, Yorkshire were on the brink of victory at Headingley after Somerset's depleted top order collapsed on day three.
Ian Harvey completed his double-century in the morning, and Craig White declared his side's first innings on 501 for nine.
The visitors - without England batsman Marcus Trescothick who has headed back south to be with his wife for the birth of their first child - were made to follow on after getting bowled out for 182. By stumps they were 104 for four in their second attempt.
Darren Robinson struck a century for Leicestershire in their tight clash with Northamptonshire at Wantage Road.
Robinson was dismissed on 100 as the Foxes were bowled out for 339 in their first innings, a deficit of 94.
At the close of play the hosts were 45 without loss, a lead of 139 runs with a day to play.