Lilley started his career in youth football alongside Jamie McAllister with BellshillBoys Club. Lilley was then signed up on a professional contract by Queen of the South at the start of the 1995–96. Lilley spent four seasons in his first spell at Palmerston Park, playing in 76 league matches and scoring 1 league goal. Lilley signed for Aberdeen at the start of the 1999–2000 season for a reported £100,000 fee. He followed Jamie McAllister to Pittodrie, both leaving Queens in the same summer. In three seasons with Aberdeen Lilley had lengthy periods sidelined with injury. He played in 25 league matches without scoring a goal. Lilley was loaned out to Ross County in 2002, where he played for the Victoria Park club in 6 league matches without scoring a goal. Lilley signed for Partick Thistle at the start of the 2002–03 season. In two seasons at Firhill, Lilley played in 49 league matches and scored 2 league goals. He then signed for Kilmarnock at the start of the 2004–05 season. During his five seasons at Rugby Park, Lilley was given the club captaincy for a certain amount of his time with the Ayrshire club. Lilley played in 112 league matches and scored 5 league goals. On 18 June 2009, for the start of the 2009–10 season, Lilley signed again for Queen of the South. Lilley was given the club captaincy at the start of the season. Lilley received the player of the year award for the 2009–10 season from the Doonhamers Travel Club. On 19 May 2011, Lilley was released by Queen of the South. Lilley spent two seasons in his second spell in Dumfries, playing in 61 league matches and scoring 2 league goals. In all competitive matches, over two spells with Queen of the South, Lilley started 157 times and appeared as a substitute 4 times, scoring 3 goals. David Lilley signed with Airdrie United on 17 June 2011 for the 2011–12 season and was appointed the club captain. In two seasons at the Excelsior Stadium Lilley played in 52 league matches without scoring a goal. Lilley departed the club when his contract expired at the end of the 2012–13 season.
Coaching career
Lilley entered football management in June 2015, with Junior club Bellshill Athletic. On 26 May 2016, Lilley resigned as the manager of Bellshill Athletic.