At the end of Batman v Superman: Dawn of Justice only Superman knows what happens inside there. How did Lois Lane understand that she has to bring the rod back to kill... the monster?
Lois doesn't need to know that the spear is made of Kryptonite, or that Kyptonite has such a destabilizing effect on Kryptonians, or even that Doomsday is Kryptonian in origin.
From her perspective, she has seen Batman wield a weapon destructive enough to almost kill Superman: the most powerful being humanity has, thus far, ever encountered. All she knows is that it is a weapon of great power, and that's all that's relevant to her.
The monster, Doomsday, was apparently some kind of Kryptonian creation and similar to the Man of Steel seemed to be immune to whatever ways of destruction people, including our three heroes, could devise against it.
So Lois's first impulse is that the Kryptonite, which she knows is some kind of weird alien material and Superman's weakness, must be of use against Doomsday, too. Even if she wasn't an expert on aliens, xeno-material sciences, or comics, it was a reasonable guess and the last straw worth a try.
Initially, I would assume that since she knows Superman would have been killed by the spear, and that the monster was really giving Batman/Superman/Wonder Woman a ton of trouble, it was probably just an educated guess that the spear would be necessary.
That said, the trigger seems to be the big explosion that happens right after Superman comes back down from the atmosphere/space and knocks Doomsday into a power plant. The film flashes to Lois who seems to think for a second before "realizing" she needs to get the spear.
I am guessing she realized the similarities in how Superman and Doomsday feed/regenerate off of energy and how Batman would have killed Superman with the spear and knew she needed to get it.
It's clearly a plot hole, there isn't a reasonable assumption that would have had her go back for the spear. For all she knows it would just hurt Superman and not the giant monster that doesn't resemble any Kryptonians. They probably cut out a scene or two that would explain why she risked her life for something she knows only hurts superman but for now no matter how much rationalizing you do it is sad they didn't do a better job.
And there isn't enough evidence for her to think Doomsday was Krytonian. All the Kryptonians she saw looked human, It was a giant monster, that created a big energy explosion and and had shards grow out of it when it was attacked. The most reasonable thought she could have had about the spear was it would just weaken Superman who was already getting smashed, not the giant monster creature that had lasers come out of its mouth and waves of energy come out of its body.
It was probably lost in the scenes they cut, this is just one of many plot holes in this movie. (people who try to "reason" she could piece it together by some vague resemblance in abilities are as about as rational as Lex Luther's reason for getting rid of Superman in the movie.)
Lois has seen Batman almost kill Superman. She has seen the negative effect Kryptonite had on Superman.
Lois was not there or was informed Doomsday was created by Zod, a fellow Kryptonian like Superman. But she was there at the battle to see Doomsday perform the same feats as a Kryptonian (super strength, flying, and laser eyes). That information makes it plausible for her to conclude that the spear could have the same negative effect on Doomsday as it did on Superman.
How did Lois know that the spear would hurt doomsday? Well, an educated guess. She knew that the monster came from the site of zods ship which is kryptonian, and she knows that the spear almost killed superman. So I mean she was pretty sure whatever was coming out of the kryptonian ship was kryptonian.