Allan Johnston's men will face off against their West Fife rivals on 1st August just two weeks before they meet at East End Park in League One.
The Pars, who were unseeded for the draw, will look to emulate their last home success over the Blue Brazil in the competition in 2003 when goals from Stevie Crawford and Craig Brewster secured a 2-0 win.
Dunfermline kick off their competitive season at Arbroath on 25th July in the Petrofac Training Cup, and their first league match of the season will be away to Brechin City on 8th August.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules here