White plays and wins in 2 moves https://lichess.org/UukFtctb
Yes, if the black king moved to a8, the game would have been longer than 5 moves
The analysis board does checkmate in 5 moves
Source:
This publication is in my collection "500 chess puzzles. Mate in 5. Advanced & Expert Level."