I took my 10-year-old son to Copenhagen and Oslo, spending 5 nights in Copenhagen, one on the ferry, and 3 in Oslo. Caveat that this was back in 2013, but I think the essentials haven't changed much. Certainly another night in Oslo would be worthwhile, but there is plenty to occupy you in Copenhagen for 5 and your two full days in Oslo will allow you to see quite a lot there. You wouldn't really go wrong either way. Here are the Oslo things we enjoyed: Akershus fortress including Resistance museum; ferry to Fram Museum (there is also another maritime museum there and the Kon-Tiki raft; unfortunately the Viking ships museum is currently closed for restoration); Frogner Park; a look inside Oslo town hall; Munch paintings at art museums (even if your child is a bit young for full enjoyment of art museums, he or she might like these); and a trip on the T subway line to the station at the end of one of the lines for a nice relatively short hike around Sognsvaan Lake. In Copenhagen: canal/harbor cruise; Viking ships in Roskilde; Kronborg castle in Helsingor (very scenic and historical); Tivoli; the National Museum especially Viking exhibits; Copenhagen zoo; an excellent aquarium (de Bla Planet); the big Lego store in central Copenhagen (I did not consider the very lengthy side trip to Legoland in Billund). The overnight ferry was a great way to get between these cities, and the way I looked at it, it basically was free transportation, because a cabin plus a nice buffet dinner (reserve early seating) was about the same price as a hotel room and dinner would have been for that night in either city, perhaps even less.
I found a multiday Copenhagen Card to be an excellent bargain: Free public transportation in the region, included admission to virtually everything we wanted to do including some otherwise expensive things such as the zoo, aquarium, and Tivoli (park admission but not the rides), and a child card was free with purchase of an adult one. However, you would want to check carefully about the current terms of the card and what attractions are now included or not, since my experience was so long ago and these things change. There was a similar card for Oslo that was also worthwhile. Our trip did not extend to the Norwegian fjords so some of what we did, such as Sognsvaan Lake, might be of lesser interest compared to the more urban attractions of Oslo given your limited time and that you will be seeing more spectacular scenery other places.