You're bound to run into that, with both being maguffin, alien invasion, team coming together.
The presentation, story elements and universe lore is what separates them. Snyder presents his world as serious, while the MCU keeps things light. Marvel and DC have their own respective 80+ year of story and history. Some things are bound to mirror the other.
With regards to lore, Avengers 1 pulled from was Asgard and the MCU WWII. With both Cap 1 and Thor 1 being set-up for what the Tesseract is and why everyone wants it. ZSJL established the Mother Boxes coming from Apokolips and being left in the charge of Atlanteans, Amazons and Mankind (Feudal and Modern). After a failed invasion by Darkseid.
Avengers 1 showed that since Cap 1 (the 40s), mankind really had not learned their lesson about how dangerous the Tesseract is. Nor did they have any plans to stop exploiting it. The Mother Box being studied by Star Labs was unanalyzable and functionally useless. It couldn't be exploited to make weapons like SHIELD and HYDRA wanted for the Tesseract. They could be used to bring Victor and Clark back to life. Of course, the villains had other plans for their respective cubes.
There are parallels, but you can watch both films and not see the eyerolling similarities Whedon, Johns and Berg wanted to insert by making the JL a clone of the popular Avengers movies.
Remember kids: The Whedonisms were totally there. Joss Whedon, film maker, extraordinaire! Haha