power (in watts) = head (in meters) * flow (in liters per second) * gravity (which is 9.81m/s^2)

Plugging in what we know:

5000 = 9.81hf

Divide by 9.81:

hf = 509.68

However, hydro generators are not perfectly efficient. On average, they are 70% efficient (with the 30% being lost to heat and other non-electrical energies).

So:

0.70hf(reallife) = 509.68

hf(reallife) = 728.12

You need the product of the head (in meters) and flow rate (in liters per second) to be 728.12.

If you prefer flow in cubic meters per second: You need the product of the head (in meters) and flow rate (in cubic meters per second) to be 0.72812.

For example, if the head is 10 meters, you'd need a flow rate of 72.8 liters (0.0728 cubic meters) per second.