If you already have one subtitle in proper sync and just want to time a second subtitle according to it (that may or may not have the exact number of lines) then you can use "alass" (
https://github.com/kaegi/alass) for it:
$ alass reference_subtitle_with_proper_sync.srt subtitle_that_needs_to_be_fixed.srt output.srt