The atomic tunneling between two tunnel-coupled Bose-Einstein condensates (BECs) in a double-well time-dependent trap was studied. For the slowly varying trap, synchronization of oscillations of the trap with oscillations of the relative population was predicted. Using the Melnikov approach, the appearance of the chaotic oscillations in the tunneling phenomena between the condensates was confirmed.