It depends. Physical borders may only photograph traffic for security purposes, no dedicated exit gate. Usually its the entry country that records your crossing, which they may or may not share with the other country.
I’m pretty sure TSA does record people exiting internationally though because people have been caught leaving after an arrest warrant has been issued, even if they made it past TSA onto the flight and into the air. TSA will know immediately if you checked in or boarded your flight.