JSFiddle - React, Tailwind, and code Playground

HTML

<body>
  <img alt="" id="image" src="https://images-na.ssl-images-amazon.com/images/I/71r8jwJFT6L._SY550_.jpg" />
  <div id="thumbnail"></div>
</body>

CSS

body {
  display: flex;
}

#thumbnail {
  display: inline-block;
  border: 1px solid black;
  width: 350px;
  height: 550px;
  
  background-repeat: no-repeat;
}

#image {
  border: 1px solid black;
}

JavaScript

var image = document.getElementById("image");
image.addEventListener("mousemove", (e) => {
  var x = e.offsetX;
  var y = e.offsetY;
  thumbnail.style.backgroundPosition = `${x}px ${y}px`;
});
var thumbnail = document.getElementById("thumbnail");
thumbnail.style.backgroundImage = `url(${image.src})`;