Yes, this should be fine, as long as the question would have been on-topic even if you didn't know the answer. Giving a good answer to a good question that you know beforehand can help the site be more useful.