You may use x=between(t, 2, 6), 0, NAN) Expression Evaluation and y=(H-h).
See overlay filter documentation (read the examples - they are close enough).
ffmpeg -y -i in.mp4 -i in.gif -filter_complex "[0][1]overlay=x='if(between(t, 2, 6), 0, NAN):y=(H-h)':format=yuv444" -vcodec libx264 -pix_fmt yuv444p -crf 17 -acodec copy out.mp4
format=yuv444 and -pix_fmt yuv444p are used for improving the output quality.
I used the transparent gif from my following post, and overlay with synthetic pattern.
Output frame sample:

Building the synthetic pattern (used for testing):
ffmpeg -y -f lavfi -r 10 -i testsrc=size=640x480:rate=1:duration=300 -vf setpts=N/10/TB -vcodec libx264 -pix_fmt yuv444p -crf 17 in.mp4
GIF image with transparency:
