Investors & landlords

I had paid taxes on compensation income for ESPP in 2018 in India. Can you please confirm if I can still claim that as foreign tax credit since I sold those ESPP stocks in 2020 while in the USA?