Make sure you get enough glue in all the corners of the countours. It can be tough to get complete coverage from all angles. If you don't glue it all, it will sag and you'll lose the definition of your pattern. Work from the middle outwards, keep the fabric pulled snug as you glue and you should be able to avoid major wrinkles.
Here's one I did:
Procedure was to glue one layer of 1/8" closed cell foam to the original headliner. I cut the flame pattern out of a second piece of foam and glued it down as a second layer. Lots of variations here, you could cut the pattern into the first layer and skip the second layer, or use patterns in both layers. Upholstery shops use contact cement from a paint gun, but for DIY use, use 3M Super90 adhesive. I've heard of using 3M Foam Fast as well, never tried it though. Don't use Super 77 on a headliner, it will be hanging over your eyes on the first day you leave it parked in the hot sun. Then glue your fabric down over top and use a popsicle stick or your finger to press it into the corners. Don't press too hard or you'll leave depressions from your fingers. It won't hurt to lightly scuff the foam before gluing either.
When gluing, lay the fabric down and fold half of it back. Start in the middle and do one side at a time. Spray your glue down and wait for it to get tacky. Keep tension on the fabric as you're laying it down and work the corners of your pattern in with the popsicle stick. Repeat for the other side. When you're done, flip it over and glue the excess fabric to the back side or just cut it off, depending what you need.
You can buy factory-style headliner fabric with the foam already attached but that's boring. You want to use a light material up there, but there's lots of room for creativity. I used Ultra-suede. Vinyl and leather work too, just watch the weight.