Niacin is fairly easy to find, here. It is a dietary supplement. It supports neurological development. I think it would do no harm to add 100 mg per gallon of water to their drinking water for a month or so. If it is a niacin (B3) deficiency, I would expect to see improvement within a week to ten days.
A trick with finding niacin that I have read on the forum, is that some places only carry no-flush, or timed-release niacin, which is not what they need. They need plain, simple niacin, preferably capsules that can be opened and mixed into water. Some have no problem finding that. Others have to look around a bit, or end up crushing tablets.
From anything I have read or seen, ducklings have different sensitivity to niacin levels. Often it's just one duckling in the lot that needs supplements. But also from what I have read or seen, it does no harm to the others to get some extra niacin.
Usually it's when the only starter feed available is chick feed that we see problems.
What was the temperature when the little was outdoors? Could he or she have been shivering a bit? Had they just had a swim? At five weeks, optimal temperatures for them would be (here I start counting on my fingers) 90F minus 5F(times 5 weeks) is 90 minus 25 is 65F is 18C. That is a ballpark, I read all kinds of hardy duckling stories. I just try to remember that not all ducklings are as hardy as the book says they are. I write from experience, here. Fünf and Sieben shivered and shook if it were lower than 40F their first autumn. More than half the flock stopped laying. I thought it wasy day-length that stopped the laying. Then I moved them all into a night shelter that was above 40F. Surprise, surprise, they all started laying again within four days.