Mr Yousaf has written to Westminster Foreign Secretary William Hague urging the UK Government to make "strong representations" to Ugandan officials on the issue.
The anti-homosexuality legislation was enacted earlier this week, strengthening the country's already strict laws relating to gay people.
Mr Yousaf said: "The Scottish Government is deeply concerned the Anti-Homosexuality Bill in Uganda has been signed into law.
"This is a huge step back for equality and I have written to the UK Government asking them to make the strongest possible representations to the government of Uganda.
"I have also urged the UK Foreign Secretary to offer asylum to any Ugandans who suffer threat or persecution as a result of the legislation.
"It goes without saying that Scotland, where possible, will play her part and assist the UK Government in providing asylum for those seeking refuge from this draconian law."
The move was welcomed by the Scottish Trades Union Congress (STUC).
General secretary Grahame Smith said: "The oppressive legislation enacted by the Ugandan government criminalising the LGBT (lesbian, gay, bisexual, and transgender) community is an affront to freedom and equality.
"The STUC welcomes this initiative by the Scottish Government and we would urge the UK Government to support this proposal to allow Ugandans, under threat of imprisonment as a consequence of their sexuality, to find refuge in Scotland."