A 5g would be OK for a shrimp, but even then, lighting and flow will be harder than in a standard 10g tank.
A 5g or 10g tank will need daily topoffs and extremely careful monitoring, so make sure you have the time to dedicate to it, also.
Be warned, saltwater keeping is expensive.