Technically, you need to use an affine perspective transformation to convert the image you want to superimpose into the background image. That is a bit hard.
Luckily there is a simpler way in Image Magick where you just define 4 points in a source image space, and then 4 points in the final image space, and Image Magick does all the calculations for you.
Using the image you provided and the code:
<?php
$overlay = new Imagick(realpath("../images/overlay.jpg"));
$imagick = new Imagick(realpath("../images/Screeny.png"));
$overlay->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_TRANSPARENT);
$width = $overlay->getImageWidth();
$height = $overlay->getImageHeight();
$points = array(
0, 0, 364, 51,
$width, 0, 473.4, 23,
0, $height, 433.5, 182,
$width, $height, 523, 119.4
);
$overlay->modulateImage(97, 100, 0 );
$overlay->distortImage(Imagick::DISTORTION_PERSPECTIVE, $points, TRUE );
//The offsets should be the minimum of the x and y values
$imagick->compositeImage($overlay, Imagick::COMPOSITE_OVER, 364.5, 23.5);
header("Content-Type: image/png");
echo $imagick->getImageBlob();
produces an image very much like:

btw I would recommend doing this at a higher resolution than required, and then down-sampling, as well as applying a transparent blur to the overlay image, to try and make it look more realistic.