I am trying to fetch current subcategory name of specific parent category which id is 5 for example my category is Brand and subcategory is Brand1/Brand2/brand3 so i want fetch current subcategory category on product page .
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$current_category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');
$parent_category = $current_category->getParentCategory();
echo $current_category->getName();
echo $parent_category->getName(); ?>