I have # 4 hinges on my garage door that are both broken. I see that #4 hinges are discontinued can I use #5 hinges?

No you cannot do that. 

The garage door hinges are each different sizes.

No. 4 hinges are for doors with 5 panels, and connect the fourth panel to the fifth panel.

No. 5 hinges are for doors with 6 panels, and connect the fifth and sixth panels.