As with any mouse position, you have to convert the 2D coordinate into one in 3D space by specifying a Z distance in front of the camera for the point, but works the same way no matter where the camera faces:
function Update() {
var v3 = Vector3(Input.mousePosition.x, Input.mousePosition.y, Camera.main.nearClipPlane);
v3 = Camera.main.ScreenToWorldPoint(v3);
Debug.DrawLine(transform.position, v3, Color.green);
}