A move to make the hourly £7.65 living wage part of all public sector contracts has been defeated in the Scottish Parliament.
Labour said it would help tackle low pay, but the Scottish government said the policy may breach European law.
As an alternative, ministers said firms seeking public contracts would have their willingness and ability to pay the living wage assessed.
The policy formed part of the government's Procurement Reform Bill.
The legislation, which was unanimously passed by MSPs at Holyrood, aims to improve the way the public sector buys goods, works and services, which comes to a cost of about £10bn a year.
Labour MSP James Kelly said of his party's proposal: "There is no doubt the living wage is an idea whose time has come.
"The Labour amendment to pay £7.65 across all public contracts would make a massive difference to the 400,000 people who are not on the living wage currently, many thousands of whom would be covered by these public contracts.
"That would give a rise to many of £2,600 a year. 64% of these people are women, so this is an opportunity not only to help women but an opportunity to tackle low pay in public contracts."
The EU's internal market commissioner, Michel Barnier, advised Labour's policy was "unlikely" to be possible, said the government.
Liberal Democrat Tavish Scott, who supported Labour's amendment to the bill, said it seemed there was room for manoeuvre, adding: "It is open to the government to press that particular point so as to see as to whether, even with a limited chance of success, it's possible."
Green MSP Patrick Harvie echoed Mr Scott's comments, adding: "Sometimes it is necessary for governments to be willing to test the boundaries of what's allowable.
"I think that's a more articulate means of making the case with colleagues in Europe than simply advocating for an issue."
But Tory MSP Alex Johnstone said it was unclear how the policy would be paid for, adding: "While I fully commend the Labour party for their long-held objective to achieve the living wage in Scotland, it is, at the same time, an inappropriate place to try and bring in this amendment."
Deputy First Minister Nicola Sturgeon said the government's own last-minute amendments to the bill meant companies bidding for public contracts would will have their willingness and ability to pay the living wage assessed.
And she said public bodies would be required to explain their living wage policy in their procurement strategies.
She told MSPs: "I want to ensure we abide by the law and that we don't put our public bodies at that risk of being taken to court."
Ms Sturgeon added: "We don't disagree with the objective of making payment of the living wage a mandatory requirement of public contracts.
"We're the first Scottish government to adopt the living wage for all of our employers and we encourage all other employers, public private, third sector, to pay their staff the living wage."