The Ospreys back came on after 54 minutes but did not complete the match after being taken off on a stretcher with three minutes remaining following an innocuous-looking tackle.
Walker went for medical assessments on the injury and a medial ligament problem was diagnosed, ruling him out of the tournament in New Zealand which begins next month.
Scotland head coach Andy Robinson, who is to name his 30-man World Cup squad on Monday, said: "Nikki has worked exceptionally hard in training and some of the running lines he made yesterday when he came off the bench were first-class.
"It's obviously disappointing for Nikki.
"We all feel for him but injuries do happen in sport and you just have to deal with them. We wish Nikki a speedy recovery."
Walker won his 24th cap on Saturday and has scored six Test tries, including in March's win over Italy in the RBS 6 Nations.
The 29-year-old will now return to his club, where he will undergo further assessments and the Ospreys medical team will lead his rehabilitation.
The injury means Robinson now has seven players to cut from his preliminary squad for the World Cup.
Scotland's Pool B campaign begins against Romania on September 10 in Invercargill.
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
$29.99
The All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.