Moving the content transform does exactly this.
scrollRect.content.transform.position -= xPixels * Vector3.right;
scrollRect.content.transform.position += yPixels * Vector3.up;
(notice the signs, they are important for desired functionality)