I took a trip to Costa Rica several years ago, it's a very beautiful place.
Firstly, yes...it does get very dark under the canopy of the trees. What I did, on some occasions, was to use flash (hotshoe mounted). It is asking a lot of your flash to light up animals that may be fairly far away, but it does help and it can give a little catchlight to the eyes, which can really make a shot. To that end, I read an article about shooting in the rain forest and the advice was to use a 'Better Beamer' which gives your flash extra distance/power for occasions such as these.
If all you have is your built-in flash, forget about it.
I didn't have 'fast' lenses when I went (neither do you), but having lenses with larger maximum apertures would certainly help to get faster shutter speeds without having to crank the ISO...but that will only get you so far. It's likely that turning up the ISO will be your go-to solution, so if you really are unhappy with the performance of your D40, then it might well be worth the upgrade.
Another thing to consider is water/moisture. The don't call it a rain forest for nothing. It rains a lot. Of course, I went during rainy season, so I probably got more rain than you might, but as it was the off-season, our tours were private and the drivers were free to take us wherever we pleased.
I did get caught with my camera, no camera bag and in a torrential downpour. It was during a zip-line forest canopy tour (which is why I couldn't bring my bag). My camera got soaked, even the inside of the screens fogged up. Luckily my camera continued to work after I let it dry out, but it was a little worrisome for a while. If you can afford it, look for a camera with weather sealing.
Also, I have a camera bag/backpack that has an all-weather cover, which came in handy several times. You have to be prepared for rain and you should be willing to shoot in it, otherwise you'll miss a lot of good photo opps. Make sure your camera is insured, so at least if it does crap out, you don't feel like garbage.
Another point is the heat & humidity. It can & will cause condensation. When you are in a cool air-conditioned space (hotel room), your gear will cool down, but when you take that cool gear out into the warm humid air, condensation will form on all the cool surfaces...just like it does when you are here in winter and you go from the cold outdoor air, into a warm building.
The trick is to let the gear warm up before exposing it to the warm air, but that can take a while, especially if your camera bag is padded (insulated). You can help by putting the gear in a zip-lock bag so that it is protected an can warm up faster, but realistically, you'll get some condensation anyway. I made sure to have several packets of silica gel (desiccant) in my camera bag, so that when I did put the gear back in, it might dry out a little bit. And I always opened up my bag when back in the hotel room, to allow things to dry as much as possible.
That's all I can thing of for now. Ask me later and I might think of some other tips.