Trailing 11-9 late in the fourth quarter, Ivovic notched his third goal of the game for Montenegro before Janovic slotted the equalizer in the upper left corner with 51 seconds to go. Goalkeeper Milos Scepanovic then denied Serbia's Andrija Prlainovic from close-range in the closing seconds to preserve the draw.
"It was very difficult, physical game," Montenegro captain Nikola Janovic said. "I think we didn't begin the match well, made a lot of mistakes, but after that we play our game and at the end I think we had a chance for a win. But this result is OK."
With the draw, Serbia remains atop Group B with five points from three matches. Montenegro is third with three points, but has its two weakest opponents to come — Romania and Britain.
Montenegro was playing catch-up the whole game after falling behind in the first quarter on a Prlainovic goal — his first of his five on the afternoon for Serbia.
But in a game that included as many shots to the face and elbows to the throat as it did goals, the Montenegro players managed to get back into the contest with sharp shooting from Ivovic and Janovic.
The intensity of the match stemmed from the countries shared history. Five players in the pool Thursday — three from Montenegro and two from Serbia — won silver as teammates for Serbia and Montenegro at the 2004 Olympics, two years before the countries separated.
"Every game against Montenegro is very stressful and very emotional," said Serbia's Filip Filipovic. "We were until yesterday, if I can say, in the same room and now we have to compete for who is going to be better and there is a very big rivalry between us."
Hungary recorded its first victory at the London Games, pulling away in the second half to beat Romania 17-15. Thursday's victory was a big one for the three-time defending Olympic champions, coming after losses in their first two matches at the games to Serbia and Montenegro.
Norbert Hosnyanszky and captain Peter Biros chipped in with three goals each for Hungary, which earned two points in Group B with the win to keep alive its chances of advancing to the quarterfinals.
"Finally," Hungary star Tamas Kasas said of the win, before qualifying that Hungary's defensive performance was "horrible."
"I don't know why but in defence things are not working well. We have to try something else," he said.
Goalkeeper Zoltan Szesci said the team was frustrated by its defensive performance so far at the tournament.
"We are hiding our defence," he joked. "I think we have to forget everything we learned about defence and start from the beginning."
Earlier Thursday, Spain earned an easy 13-9 win over Australia behind goals from 10 different players.
Every outfield player except Balazs Sziranyi Somogyi scored for Spain, which is looking for its first Olympic medal in men's water polo since winning gold in 1996.
"We are really happy because we think that more than the result, the feeling is that the team is playing together," said Filipe Perrone Rocha, who scored two goals to raise his tournament tally to nine.
Spain's win comes after a disputed 8-7 loss on Tuesday to Croatia, in which the officials didn't recognize a last-gasp Spanish shot that appeared to cross the line to level the game at the buzzer. Spain lodged an appeal to FINA, which the sport's governing body rejected.
Spain has four points from three Group A matches, positioning it well for a spot in the quarterfinals, while Australia has just two points from three games.
Greece also improved its chances of reaching the knockout stage with its easy 11-4 win over Kazakhstan behind five goals from Ioannis Fountoulis. The Greeks were never threatened in the match, holding their opponents scoreless for a 14-minute stretch to build a 7-1 lead halfway through the third quarter.
Greece has three points from three Group A games, with Spain and Australia still to come in the preliminary stage. Kazakhstan is winless and at the bottom of the group.
Thursday's last Group A game pits group leader Croatia against reigning world champion Italy, while in Group B the United States looks to extend its perfect record in London when it takes on Britain.
Ryan Lucas can be reached on twitter at www.twitter.com/relucaszSuggest a correction