No, a 5-gallon tank is too small for a turtle. Turtles need ample space to swim and explore, and a 5-gallon tank does not provide enough water depth—turtles need water at least 2–3 times the length of their shell.
Most turtles require a tank of at least 10 gallons, along with a filter, heater, and basking spot.