i would say the one sitting on the little girls lap was protecting the little girl and when the other one jumped up they reacted, could be one is coming in season, could be a smell your niece had on her maybe even from another dog.
i wouldnt get to worried if its only happened once, but i would next time your niece comes over not let them on her lap just incase she gets hurt.