Brazil were leading thanks to Jheniffer's strike but conceded two stoppage time goals to Japan, who collected their first points after a defeat by Spain in Thursday's opener, courtesy of Saki Kumagai and Momoko Tanikawa.
Colombia bounced back after falling to hosts France and boosted their chances of making it to the next round with their first win thanks to Marcela Restrepo's volley and a goal from Leicy Santos.
The top two teams in each three groups advance, along with two best third-placed sides.
Brazil went ahead with a fine Jheniffer low shot in the 56th minute after a goal created by six-time Olympian Marta, who left the pitch to a standing ovation six minutes from time.
Japan, who had missed a penalty before halftime, levelled in stoppage time thanks to Kumagai's kick from the spot after a handball by Yasmim before substitute Tanikawa netted from long range after a misplaced pass by Rafaelle.
Elsewhere, Colombia opened the scoring in the 26th minute with a brilliant volley by Restrepo, who pounced on some sloppy New Zealand defending.
Leicy Santos's fine strike off the woodwork sealed the win for Colombia in the 72nd minute to move them on to three points.
Hosts France and world champions Spain play later on Sunday, along with Australia, Canada, Germany and the United States.