It depends on the room temperature of where you are keeping the aquarium in... If it very cold (eg: 50F, I'm not sure where), a 50W should do it, as a 25W wouldn't be able to maintain that large of a temperature difference. Most usually, a 25W would do fine for a 5G aquarium.
Just keep in mind the room temperature that the aquarium will in.