Let's say you have a gravity force g
(m/s²). The horizontal speed doesn't change, so you first need to calculate the amount of time it reaches the target horizontally:
t = distanceX / speedX
The object need tk reach the target in the same time vertically too. We will have a speed of vY
(m/s) at start and vY - g * t
(m/s) at the end vertically (positive speed goes upwards). The average vertical speed is
vAvg = (vY + vY - g * t) / 2 = vY - g * t / 2
This average speed needs to be so big, that the object would reach the target position in time t if there's no gravity
vY - g * t / 2 = distY / t
You should be able to get the starting upwards velocity by adding g * t / 2
to distY / t
So, together, to get the vertical speed vY, you need to do:
t = distX / vX
vY = distY / t + g * t / 2