yes, the count of total cores in all the servers together should not exceed the licensed cores.
4 core + 2x2 = 8 cores. Your license fits for this 8 core configuration. If you want to add more servers you need to get license for those cores.
What happens if they are both 8 core but on the same Blade/ESXI and share the same virtual cores but are different VMs?