No connection between the two statements. It's true that the database will try to ensure that only the two log files' worth of log records will need to be redone during recovery by writing bufferpool pages out to disk when the gap between logged changes and persisted changes exceeds 2 log files in your example (LSN gap page cleaning trigger).
However, whether the "long" (5 log files long) transaction can be recovered or not depends only on whether it was committed before the crash or not. If it was committed, DB2 will only need to replay 2 log files. If it was not committed, it will still replay 2 log files, but then undo the changes made by the uncommitted transaction, going back 5 log files.