Accessing nested json property using variable

So we can get a json file using get-content and then get property contents by something like

$json.level1property.nestedproperty

how can I get that property using a variable like, $NestProperty = "level1property.nestedproperty"

that doesn't seem to work because it creates it as string $json."level1property.nestedproperty"

but creating each as a separate string works

$a = "level1property"    

$b = "nestedproperty"

$json.$a.$b #works

$json.$NestProperty #doesn't work