Wilson then signed for Dunfermline Athletic on 5 August 2002. He made his Dunfermline debut in a 6–0 defeat to his former employers Rangers, just two weeks later. Wilson played in the 2006 Scottish League Cup Final and the 2007 Scottish Cup Final, both of which ended in defeat to Celtic; his defensive colleagues included former Rangers youth teammate Greg Shields. He scored one of Dunfermline's goals in the 2007 Scottish Challenge Cup Final, but this was also lost to St Johnstone. One of his last appearances for the club in April 2009 was an opportunity to reach another final, but the Scottish Cup semi-final at Hampden Park was lost to Falkirk, one of their local rivals. In his seven-year spell at Dunfermline, he played in over 200 fixtures in the league alone.
