Relating homological dimensions to relative homological dimensions