Intention does not change theft into a good.
Nor does circumstances.
However in the the case of necessary use of say “food” such is simply not theft.
See CCC for details of such.
2408 The seventh commandment forbids theft, that is, usurping another’s property against the reasonable will of the owner. There is no theft if consent can be presumed or if refusal is contrary to reason and the universal destination of goods. This is the case in obvious and urgent necessity when the only way to provide for immediate, essential needs (food, shelter, clothing . . .) is to put at one’s disposal and use the property of others.191