Would replacing the battery trigger the check engine light to come on a 99 Sienna?

My check engine light came on because the terminals were not connected tightly. no. quite the contrary. if you have a "check engine" light on, disconnecting, or in this case replacing the battery will turn it off. you have a different problem.