As mentioned by @Fishtoaster (and as depicted in the cat gif) pouring over the back of a spoon is definitely a must - you really want to make sure none of the top layer breaks into the bottom layer.
There are a few other ways to make your layering more effective as well.
As seen in the animated gif, a curved beer glass is used. Ideally, you want it to have this shape

(source: kegerator.com)
If you use a regular pint glass it will have a greater potential of mixing the layers.
A common mistake when making these layers is to get as close to 50% as possible. The downside is that as you drink it, it will mix with these portions. Ideally, you should be looking at a 70% base, 30% top in order to have and maintain two defined layers.