BJTs are current driven devices not voltage. You need to calculate how much current goes from the base to the emitter, based on how much current you need in the collector circuit.
You don't need a voltage divider, you only need a base resistor that can be calculated as follows. Use your second diagram, but eliminate the 10K resistor to ground.
Ic is the desired collector current, this is the current required by your relay coil
Ib is the required base current. This is Ic / Hfe
Vin is the voltage the base resistor will be connected to.
Rb is the base resistor.
0.6V is the typical voltage drop from the base to the emitter.
From Ohm's law:
(Vin - 0.6) = Ib Rb
Rb = (Vin - 0.6) / Ib
This would give you the base resistor needed if the Hfe was exactly right. You want to actually use about 1/2 that to double the current to make sure the transistor is saturated.
Example:
Ic = 100ma
Hfe = 100
Ib = Ic / Hfe = 1ma
Vin = 5V
Rb = (5 - 0.6) / 0.001 = 4400 Ohms
Use 2.2K Ohms to make sure there is plenty of base current to saturate.
Bob