The Nikon AF-S 40mm f/2.8 Micro Nikkor would be a good inexpensive lens for either of your cameras. I use it with my D7000 and I'm quite pleased with the results. Your cameras have better sensors so this lens should perform even better. Nikon also sells other FX and DX macro lenses of varying focal lengths should you find the 40mm too constraining.
One thing you have to understand about macro photography is that the closer you get, the less depth of focus you'll have. Focusing will be very critical and you may find that you can't rely on your auto focus to nail the shot. So, you need to take that into consideration when deciding how to shoot your flower images. Lighting is also very important, and can be difficult to obtain given how close you'll be to your subject. Off camera lighting is usually the best way to go but, if you don't wish to deal with the hassle, you may wish to consider a ring light to mount on the front of your lens. Even very inexpensive ring lights can have a dramatic affect on your photos.
Of course, this just barely scratches the surface of macro photography. There's a lot to learn but discovery is half the fun of shooting macro.
--Ron