I don't think it would work well. Either you're going to blast your fish with a lot of UV
rays or, if you have a glass lid, the UV
rays will be blocked and not really do much of anything. I don't know if you'd get enough intensity to do much anyways.
Is there any reason you're looking to add a UV
sterilizer, other than as a preventative measure? Some people swear by them, but most seem to think they're a waste of money.