Not necessarily. Aftershaves tend to be light scented (much less scent then the equivalent cologne) and/or of very low staying power (due to comparatively higher alcohol content). I don't match my aftershave and cologne and have never noticed a conflict. Timing, tho,might be important.
By-in-large I use the aftershave which goes with the cologne, or one that closely matches. Obssession cologne gets Obssession aftershave. Guerlain Habit Rouge cologne gets C-M Tricorn because it is close and I don't want to splurge for the Habit Rouge aftershave. Likewise T&H Spanish Leather cologne gets matched with D.R. Harris Sandalwood aftershave - at least so far. Others suggest using an unscented aftershave so as not to clash. And still others use their aftershave double-duty as their cologne.
What I'll do is when I use AS, I tend to apply it all over my face and neck. If I'm using a cologne I'll use the same scent as the AS, and just apply it to certain areas, as it tends to be stronger than the AS. Those areas are behind the ear lobes, the temples, the pulse area of the neck, and on either side of the rib cage.
I don't get too worked up about matching AS and cologne. Since AS is generally weak I just wait till I'm about to leave the house to put on cologne. This is about 30 minutes after applying AS.
That said I try to match styles. Your know spicy AS with spicy cologne.
Try it and see what works for you. All this stuff smells so good how could it hurt to layer it.