On his return to Sheffield Wednesday in May 2005, Foster was released and later joined League Two side Lincoln City on a one-year contract ahead of the 2005–06 season. Foster made his debut for Lincoln in the club's first game of the season, a 2–1 defeat to Notts County. However, Foster did not feature again for Lincoln during the 2006–07 campaign and after training with York City, he joined the Conference National team on a one-month emergency loan on 5 October 2006 due to injuries to defenders, making his debut for the club the following day in a 1–0 win against Aldershot Town. This loan deal was extended for a second month in November, but after Foster suffered an ankle injury during the last week of the loan, he returned to his parent club in December. He made his last appearance for York in the club's 1–0 loss to League One side Bristol City in the FA Cup first round. He made seven appearances for York during a two-month loan spell with the club.