First of all, I suppose you wanted to ask about accuracy, not field width. So your example should look like
printf( "%.5s", (const char*) not_a_c_string );
instead
printf( "%5s", (const char*) not_a_c_string );
Given the above approach, no, this will not be UB in your example.
C11, §7.21.6.1, fprintf, 8 ( )
s l, . (280) ( ) . , , . , .
, (string),
(5) , ( 5). , .
FWIW,
printf( "%5s", (const char*) not_a_c_string );
UB, .