A small fish such as a Trimma, Clown, or Masked Goby would be fine a 5 gallon tank. The largest fish I would keep in a 5 gallon would be a 1-1/2" Goby. Small Gobies are not very active as they mainly perch on structure, and contribute very little as far as bioload is concerned. With adequate filtration, and a good maintenance schedule it is possible.
Just my opinion.