diff --git a/Filesystem.php b/Filesystem.php
index 524d17c2b..b2b65f881 100644
--- a/Filesystem.php
+++ b/Filesystem.php
@@ -508,7 +508,7 @@ public function makePathRelative(string $endPath, string $startPath)
         $endPathRemainder = implode('/', \array_slice($endPathArr, $index));
 
         // Construct $endPath from traversing to the common path, then to the remaining $endPath
-        $relativePath = $traverser.('' !== $endPathRemainder ? $endPathRemainder.'/' : '');
+        $relativePath = $traverser.('' !== $endPathRemainder ? (is_dir($endPath)?$endPathRemainder.'/':$endPathRemainder) : '');
 
         return '' === $relativePath ? './' : $relativePath;
     }